:root {
  --accent: #00d1ff;
  --bg: #0a0f1a;
  --glass: rgba(255, 255, 255, 0.05);
  --text: #fff;
  --muted: #94a3b8;
  --warning-bg: rgba(255, 87, 87, 0.1);
  --warning-border: #f41010;
  --warning-text: hsl(52, 100%, 54%);
}

body.light-theme {
  --accent: #0077cc;
  --bg: #ffffff;
  --glass: rgba(0, 0, 0, 0.05);
  --text: #1a1a1a;
  --muted: #666666;
  --warning-bg: rgba(255, 87, 87, 0.1);
  --warning-border: #ff4444;
  --warning-text: #d63031;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 16px;
}

body {
  min-height: 100%;
  width: 100%;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  touch-action: manipulation;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}


.auth-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  width: min(100%, 400px);
}

.auth-tabs div {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tabs .active {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-card {
  width: min(100%, 400px);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.auth-card.active {
  display: flex;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 0.875rem;
  color: var(--accent);
  font-size: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-bottom: 0.5rem;
}
.input-group input:focus {
  border-color: var(--accent);
}
.input-group input {
  background: rgba(255,255,255,0.07);
  border: 1px solid #0f172acf;
  border-radius: 8px;
  padding: 0.875rem;
  color: var(--text);
  font-size: 0.9375rem;
  outline: none;
  width: 100%;
}

.input-group input::placeholder {
  color: var(--muted);
}

.input-group label {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.email-code-wrapper {
  position: relative;
}

.email-code-wrapper input {
  padding-right: 5.625rem;
}

.send-code {
  position: absolute;
  right: 0.5rem;
  top: 2.25rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #000;
  cursor: pointer;
  font-weight: 500;
}

.auth-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.875rem;
  font-weight: 600;
  font-size: 1rem;
  color: #000;
  cursor: pointer;
  margin-top: 0.625rem;
  width: 100%;
  transition: opacity 0.2s ease;
}

.auth-btn:hover {
  opacity: 0.9;
}

@media (max-width: 480px) {
  body {
    padding: 1rem 0.75rem;
  }

  .auth-card {
    padding: 1.25rem 1rem;
  }

  .auth-card h2 {
    font-size: 1.25rem;
  }

  .input-group input {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .send-code {
    padding: 0.3125rem 0.5rem;
    font-size: 0.6875rem;
    top: 2rem;
  }

  .auth-btn {
    padding: 0.75rem;
    font-size: 0.9375rem;
  }
}

@media (max-height: 700px) {
  body {
    padding: 0.75rem;
  }

  .auth-tabs {
    margin-bottom: 1rem;
  }

  .input-group {
    margin-bottom: 0.375rem;
  }

  .auth-card {
    gap: 0.75rem;
  }
}

.forgot-password {
  text-align: right;
  margin-bottom: 1rem;
}

.forgot-password a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
}

.forgot-password a:hover {
  text-decoration: underline;
}

.app-downloads {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
}

.app-downloads h3 {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.download-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: transform 0.2s;
}

.download-btn:hover {
  transform: translateY(-2px);
}

.download-btn img {
  height: 24px;
  width: auto;
}

@media (max-width: 768px) {
  .download-buttons {
    flex-direction: column;
    align-items: center;
  }
}

.auth-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-color);
  margin-top: 0.5rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#resetPasswordForm {
  transition: all 0.3s ease;
  max-width: 400px;
  margin: 0 auto;
}

.reset-step {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reset-step.active {
  display: block;
  opacity: 1;
}

#resetVerificationCode {
  letter-spacing: 4px;
  font-size: 1.2rem;
  text-align: center;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.toggle-password:hover {
  color: var(--text-primary);
}

.verify-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 4px;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
}

.verify-btn:hover {
  opacity: 0.9;
}

.verification-field {
  position: relative;
  width: 100%;
}

.verification-field input {
  width: 100%;
  padding-right: 120px;
}

.verify-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.verify-btn:disabled {
  background: var(--bg-secondary);
  cursor: not-allowed;
}

.timer {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#verificationCode {
  letter-spacing: 4px;
  font-size: 1.2rem;
  text-align: center;
}


.send-code:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.countdown-timer {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}


.buttons a {
    text-decoration: none;
    color: inherit;
    display: contents;
}

.buttons a:hover {
    text-decoration: none;
}


/* Add to Home Screen Modal Styles */
.homescreen-modal {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(10,15,26,0.85);
  backdrop-filter: blur(8px);           /* Blur the background */
  -webkit-backdrop-filter: blur(8px);   /* Safari support */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5em;
}

.homescreen-modal-content {
  background: #181f2e;
  color: #fff;
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;                    /* Limit height */
  overflow-y: auto;                    /* Make content scrollable */
  padding: 2em 1.5em 1.5em 1.5em;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: relative;
  animation: fadeIn 0.3s;
}
.homescreen-modal-close {
  position: absolute;
  right: 0.41em;
  top: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-weight: 700;
}
.homescreen-modal-close:hover {
  opacity: 1;
}
.homescreen-modal-content h3 {
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  color: #00d1ff;
  font-size: 1.35em;
  text-align: center;
}
.homescreen-modal-content p {
  text-align: center;
  color: #b5c7e7;
  margin-bottom: 1.5em;
  font-size: 1em;
}
.homescreen-steps {
  display: flex;
  flex-direction: column;
  gap: 2em;
}
.homescreen-step {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 1em 0.7em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.homescreen-step-title {
  font-weight: 600;
  color: #00d1ff;
  margin-bottom: 0.7em;
  font-size: 1.08em;
}
.homescreen-step ol {
  margin: 0;
  padding-left: 1.2em;
}
.homescreen-step ol li {
  margin-bottom: 1.5em;
  font-size: 1.05em;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.homescreen-illustration {
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0.7em 0 0.2em 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
  align-self: center;
  border: 2px solid #00d1ff33;
  object-fit: contain;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.homescreen-illustration:hover,
.homescreen-illustration:focus {
  box-shadow: 0 8px 32px rgba(0,209,255,0.18);
  border-color: #00d1ff;
}
@media (max-width: 600px) {
.homescreen-modal {
  width: 415px;
  margin-left: -15px; /* Center modal */
  margin-top: -20px;
}
  .homescreen-modal-content {
    padding: 0.11em 0.5em 1em 0.5em;
    max-width: 100%;
  }
  .homescreen-illustration {
    max-width: 98vw;
    width: 100%;
  }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97);}
  to { opacity: 1; transform: scale(1);}
}
}