/* --------------------------------------------- */
/* 1. RESET & GLOBAL STYLES                     */
/* --------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* --------------------------------------------- */
/* 2. BODY & CONTAINER                           */
/* --------------------------------------------- */
body {
  background: linear-gradient(120deg, #f4f6f8 0%, #eef2f6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 6rem;
  color: #333;
  min-height: 100vh;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 450px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------- */
/* 3. FORM ELEMENTS                              */
/* --------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.2rem;
}

label {
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input,
select {
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border 0.2s ease;
  outline: none;
}

input:focus,
select:focus {
  border-color: #007BFF;
}

small.time-status {
  font-size: 0.85rem;
  color: #777;
  margin-top: 0.4rem;
}

/* --------------------------------------------- */
/* 4. TOTP DISPLAY & BUTTONS                    */
/* --------------------------------------------- */
.totp-section {
  text-align: center;
  margin: 1.5rem 0;
}

.countdown {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.totp-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: #007BFF;
  margin: 0.5rem 0;
  letter-spacing: 6px;
}

.next-totp {
  font-size: 1rem;
  color: #333;
  margin-top: 0.4rem;
}

.buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.btn-totp {
  cursor: pointer;
  border: none;
  background: #007BFF;
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.1s ease;
  position: relative;
}

.btn-totp:hover {
  background: #005bbf;
}

.btn-totp:active {
  transform: scale(0.97);
}

.btn-url {
  cursor: pointer;
  border: none;
  background: #17a2b8;
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.1s ease;
  position: relative;
}

.btn-url:hover {
  background: #138996;
}

.btn-url:active {
  transform: scale(0.97);
}

button.copied {
  background: #28a745 !important;
}

/* --------------------------------------------- */
/* 5. INFO & FOOTER                             */
/* --------------------------------------------- */
.info {
  max-width: 450px;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.info code {
  background: #cdd9e5;
  padding: 2px 6px;
  border-radius: 4px;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  color: #333;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  padding: 0.8rem 0.5rem;
  z-index: 999;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 auto;
}

.footer a {
  text-decoration: underline;
  color: inherit;
}

.footer-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.footer-content p:last-of-type {
  opacity: 0.8;
}

/* --------------------------------------------- */
/* 6. ADVANCED SETTINGS TOGGLE                  */
/* --------------------------------------------- */
.lead-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: 1rem;
  background-color: #fafafa;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  color: #333;
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.advanced-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #007BFF;
  margin-bottom: 1rem;
  font-weight: 600;
  user-select: none;
  text-decoration: none;
  cursor: pointer;
}

.advanced-settings-toggle .arrow {
  margin-right: 6px;
}

.advanced-settings-toggle .arrow svg {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  display: block;
  fill: currentColor;
}

.advanced-settings {
  background: #f8f9fa;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.advanced-settings .note {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

/* --------------------------------------------- */
/* 7. DARK MODE (PREFERS-COLOR-SCHEME: DARK)    */
/* --------------------------------------------- */
@media (prefers-color-scheme: dark) {
  body {
    background: #1c1c1c;
    color: #ddd;
  }
  .container {
    background: #2a2a2a;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }
  label {
    color: #ccc;
  }
  input,
  select {
    background: #3a3a3a;
    border-color: #555;
    color: #ddd;
  }
  .time-status {
    color: #aaa;
  }
  .countdown {
    color: #aaa;
  }
  .totp-value {
    color: #66aaff;
  }
  .next-totp {
    color: #ccc;
  }
  .btn-totp {
    background: #66aaff;
    color: #000;
  }
  .btn-totp:hover {
    background: #55a0ee;
  }
  .btn-url {
    background: #5fd3df;
    color: #000;
  }
  .btn-url:hover {
    background: #47c0cb;
  }
  .info code {
    background: #333;
  }
  .info {
    color: #888;
  }
  .advanced-settings-toggle {
    color: #66aaff;
  }
  .advanced-settings {
    background: #333;
    border: 1px solid #555;
  }
  .advanced-settings .note {
    color: #ccc;
  }
  .footer {
    background: #2a2a2a;
    color: #ddd;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.4);
  }
  .footer-content p {
    color: #ccc;
  }
  .lead-description {
    background-color: #333;
    color: #ddd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
