@import url("https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700&display=swap");

/* ─── Variables ───────────────────────────────────────────── */
:root {
  --orange:        #F97316;
  --orange-light:  #FFEDD5;
  --orange-mid:    #FED7AA;
  --orange-dark:   #C2410C;
  --orange-border: rgba(249, 115, 22, 0.28);
  --orange-glow:   rgba(249, 115, 22, 0.09);
  --bg:            #FFFAF5;
  --surface:       #FFFFFF;
  --text:          #1C1917;
  --text-muted:    #78716C;
  --radius-sm:     10px;
  --radius-md:     16px;
  --shadow:        0 4px 24px rgba(249, 115, 22, 0.09);
  --shadow-hover:  0 8px 32px rgba(249, 115, 22, 0.18);
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  font-family: "Lato", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  display: grid;
  min-height: 100vh;
  place-items: center;
  margin: 0;
}

h1 {
  font-size: 1.4rem;
  color: var(--orange-dark);
  font-weight: 700;
}

/* ─── Timer circle ────────────────────────────────────────── */
.base-timer {
  position: relative;
  width: 300px;
  height: 300px;
}

.base-timer__svg {
  transform: scaleX(-1);
}

.base-timer__circle {
  fill: none;
  stroke: none;
}

.base-timer__path-elapsed {
  stroke-width: 7px;
  stroke: var(--orange-mid);
}

.base-timer__path-remaining {
  stroke-width: 7px;
  stroke-linecap: round;
  transform: rotate(90deg);
  transform-origin: center;
  transition: 1s linear all;
  fill-rule: nonzero;
  stroke: currentColor;
}

/* info / normal — main orange */
.base-timer__path-remaining.green {
  color: var(--orange);
}

/* warning — dark orange */
.base-timer__path-remaining.orange {
  color: var(--orange-dark);
}

/* alert — red */
.base-timer__path-remaining.red {
  color: #DC2626;
}

.base-timer__label {
  position: absolute;
  width: 300px;
  height: 300px;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
}

/* ─── Timer container ─────────────────────────────────────── */
#timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ─── Sound toggle ────────────────────────────────────────── */
.sound-toggle {
  background: none;
  border: none;
  width: auto;
  height: auto;
  padding: 4px 8px;
  font-size: 75px;
  color: var(--orange-mid);
  opacity: 1;
  cursor: pointer;
  transition: color 0.18s;
}

@media (min-width: 768px) {
  .sound-toggle {
    font-size: 62px;
  }
}

.sound-toggle:hover {
  color: var(--orange);
}

.sound-toggle.enabled {
  color: var(--orange);
}

/* ─── Buttons ─────────────────────────────────────────────── */
button {
  background-color: var(--orange);
  border: none;
  width: 120px;
  height: 50px;
  color: white;
  padding: 10px 0;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
  opacity: 0.9;
}

button:hover {
  background-color: var(--orange-dark);
  opacity: 1;
}

.disabled-button,
button:disabled {
  background-color: var(--text-muted);
  cursor: auto;
}

.disabled-button:hover,
button:disabled:hover {
  background-color: var(--text-muted);
}

/* ─── Timer input dialog ──────────────────────────────────── */
.open-button {
  background-color: var(--orange);
  color: white;
  padding: 16px 20px;
  border: none;
  cursor: pointer;
  opacity: 0.9;
  position: fixed;
  bottom: 23px;
  right: 28px;
  width: 280px;
  border-radius: var(--radius-sm);
}

.form-popup {
  display: none;
  position: fixed;
  top: 40%;
  right: 10%;
  border: 1.5px solid var(--orange-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  z-index: 9;
}

.form-container {
  max-width: 300px;
  padding: 16px;
  background-color: var(--surface);
  text-align: center;
  border-radius: var(--radius-md);
}

input {
  width: 72px;
  padding: 10px;
  margin: 5px 10px 18px 0;
  border: 1.5px solid var(--orange-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 1.2rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.13);
  outline: none;
  font-size: 1.4rem;
  background: var(--surface);
}

.form-container label {
  margin-right: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-container .btn {
  background-color: var(--orange);
  color: white;
  height: auto;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  width: 40%;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background-color 0.15s;
}

.form-container .cancel {
  background-color: var(--text-muted);
}

.form-container .btn:hover { background-color: var(--orange-dark); }
.form-container .cancel:hover { background-color: #57534E; }
.open-button:hover { opacity: 1; background-color: var(--orange-dark); }

/* ─── QR code overlay ─────────────────────────────────────── */
#qr-corner {
  position: fixed;
  bottom: 16px;
  right: 16px;
  text-align: center;
  opacity: 0.75;
}

#qr-corner-left {
  position: fixed;
  bottom: 16px;
  left: 50px;
  text-align: center;
  opacity: 0.75;
}

#qr-corner-left img {
  display: block;
  width: 115px;
  height: 115px;
  border-radius: var(--radius-sm);
}

#qr-corner-left p {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

#qr-corner canvas {
  display: block;
  width: 96px;
  height: 96px;
}

#qr-corner p {
  margin: 4px 0 0;
  font-size: 9px;
  color: var(--text-muted);
  word-break: break-all;
  max-width: 96px;
}
