*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.5;
  font-family: "Poppins", sans-serif;
  background-color: #0f0f0f;
  color: #fff;
  flex-direction: column;
  min-height: 100vh;
}

input,
button,
textarea,
select {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.flex {
  display: flex;
}
.poppins-regular {
  font-family: "Poppins", sans-serif;
  font-weight: 400;
}
.poppins-bold {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}
.hidden {
  display: none !important;
}

/* ===== Header ===== */
header {
  padding: 14px 5%;
  background-color: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}
.brand {
  font-size: 20px;
  color: #fff;
}

/* ===== Layout ===== */
.container {
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.timer-wrapper {
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 600px;
}

/* ===== Display ===== */
.display {
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.time-block {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.time-num {
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}

.time-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.separator {
  font-size: clamp(40px, 8vw, 70px);
  font-weight: 300;
  color: #444;
  line-height: 1;
  margin-top: 2px;
}

/* ===== Finished Message ===== */
.finished-msg {
  font-size: 24px;
  font-weight: 600;
  color: #6c3dd3;
  text-align: center;
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.4;
  }
}

/* ===== Input Area ===== */
.input-area {
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.field {
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: #aaa;
}

input[type="datetime-local"] {
  padding: 12px 16px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

input[type="datetime-local"]:focus {
  border-color: #6c3dd3;
}

/* ===== Controls ===== */
.controls {
  gap: 10px;
}

.controls button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s,
    opacity 0.2s;
}

.controls button:active:not(:disabled) {
  transform: scale(0.95);
}

#startBtn {
  background-color: #6c3dd3;
  color: #fff;
}
#startBtn:hover:not(:disabled) {
  background-color: #5a2db8;
}

#pauseBtn {
  background-color: #2a2a2a;
  color: #fff;
}
#pauseBtn:hover:not(:disabled) {
  background-color: #333;
}

#resetBtn {
  background-color: #2a2a2a;
  color: #fff;
}
#resetBtn:hover:not(:disabled) {
  background-color: #333;
}

.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Error ===== */
.error {
  background-color: #2a0a0a;
  color: #f87171;
  border: 1px solid #7f1d1d;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  text-align: center;
}

/* ===== Desktop ===== */
@media (min-width: 768px) {
  .timer-wrapper {
    gap: 50px;
  }
  .display {
    gap: 16px;
  }
}
