:root {
  --bg: #1B3044;
  --bg-accent: #0d1d3a;
  --text: #f5f7ff;
  --muted: #f6f8ff;
  --orange: #ffb300;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

/* Loader Screen */
.loader-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 45%),
    var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1;
}

.loader-logo {
  width: 230px;
  height: auto;
  filter: drop-shadow(0 30px 35px rgba(2, 6, 23, 0.7));
}

.loader-logo + .spinner {
  margin-top: 1.5rem;
}

.loader-text {
  margin-top: 1rem;
  font-size: 1rem;
  color: rgba(245, 247, 255, 0.9);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.loader-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.18);
  border-left-color: var(--orange);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Login Screen */
.login-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow-y: auto;
}

.login-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.login-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 1.5rem;
}

.logo {
  width: 200px;
  height: auto;
  margin: 0 auto 4rem;
  display: block;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.input-group {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 auto;
}

.input-group label {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-align: left;
  width: 100%;
}

.input-group input {
  width: 100%;
  padding: 0.75rem 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-bottom-color 0.2s ease;
  text-align: left;
}

.input-group input::placeholder {
  text-align: left;
}

.input-group input:focus {
  border-bottom-color: var(--orange);
}

/* Vibration animation */
@keyframes vibrate {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.input-group input.vibrate {
  animation: vibrate 0.5s ease-in-out;
  border-bottom-color: #ff6c6c;
}

.input-group input.vibrate::placeholder {
  color: rgba(255, 108, 108, 0.7);
}

.form-options {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--orange);
}

.remember-me span {
  user-select: none;
}

.forgot-link {
  color: var(--orange);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.forgot-link:hover {
  opacity: 0.8;
}

.signin-button {
  width: 100%;
  max-width: 320px;
  padding: 1rem 0;
  margin: 1rem auto 0;
  background: var(--orange);
  color: #031633;
  border: none;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: block;
}

.signin-button:hover {
  opacity: 0.95;
}

.signin-button:active {
  transform: scale(0.99);
}

.register-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.register-link span {
  margin-right: 0.25rem;
}

.register-text {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.register-text:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .loader-screen {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .loader-logo {
    width: 190px;
  }

  .login-screen {
    padding: 1.5rem 1rem;
    padding-top: 2rem;
  }

  .login-container {
    padding-top: 1rem;
  }

  .logo {
    width: 180px;
    margin-bottom: 3.5rem;
  }

  .login-form {
    gap: 1.25rem;
  }

  .input-group input {
    font-size: 0.95rem;
    padding: 0.65rem 0;
  }

  .signin-button {
    padding: 0.9rem 0;
    font-size: 0.95rem;
  }
}

@media (max-width: 420px) {
  .loader-screen {
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .login-screen {
    padding: 1.25rem 0.75rem;
    padding-top: 1.5rem;
  }

  .logo {
    width: 160px;
    margin-bottom: 3rem;
  }

  .form-options {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .input-group input {
    font-size: 0.9rem;
  }

  .signin-button {
    padding: 0.85rem 0;
    font-size: 0.9rem;
  }
}

/* Register Screen */
.register-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow-y: auto;
}

.register-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.register-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 1.5rem;
}

.register-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .register-screen {
    padding: 1.5rem 1rem;
    padding-top: 2rem;
  }

  .register-container {
    padding-top: 1rem;
  }
}

@media (max-width: 420px) {
  .register-screen {
    padding: 1.25rem 0.75rem;
    padding-top: 1.5rem;
  }
}

/* OTP Screen */
.otp-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  padding-top: 1rem;
  text-align: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow-y: auto;
  background: var(--bg);
}

.otp-screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.otp-back-button {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 100;
  min-height: 44px;
  min-width: 80px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
  pointer-events: auto;
}

.otp-back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.otp-back-button:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.98);
}

.otp-logo {
  width: 200px;
  height: auto;
  margin: 2rem auto 2.5rem;
  align-self: center;
}

.otp-form-wrapper {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

.otp-instruction {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.15;
  text-align: center;
  width: 100%;
}

.otp-label {
  display: block;
  text-align: center;
  width: 100%;
  color: rgba(245, 247, 255, 0.7);
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.otp-input-box {
  width: 320px;
  max-width: 92vw;
  margin: 0 auto 0.75rem;
  display: block;
  box-sizing: border-box;
}

.otp-input-box input {
  width: 100%;
  height: 56px;
  background: #0b1d3a;
  border-radius: 12px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  color: #ffffff;
  border: none;
  letter-spacing: 0.3em;
  box-sizing: border-box;
  max-width: 100%;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.5);
  display: block;
  line-height: 56px;
  font-family: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.primary {
  width: 100%;
  padding: 0.85rem 0;
  border-radius: 0;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--orange);
  color: #031633;
  transition: transform 0.2s ease;
}

.primary:active {
  transform: scale(0.99);
}

.otp-verify {
  width: 320px;
  max-width: 92vw;
  margin: 20px auto 0;
  border-radius: 12px;
  height: 56px;
  padding: 0;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #ffb300;
  color: #000000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(255, 179, 0, 0.12);
  border: none;
  box-sizing: border-box;
}

/* Force exact matching on all devices (override mobile UA styles) */
.otp-input-box,
.otp-verify {
  width: 320px !important;
  max-width: 92vw !important;
  height: 56px !important;
  box-sizing: border-box !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
  padding: 0 !important;
  border-radius: 12px !important;
}

.otp-input-box input {
  width: 100% !important;
  height: 56px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  display: block !important;
  line-height: 56px !important;
}

.otp-resend-line {
  margin-top: 0.9rem;
  color: rgba(245, 247, 255, 0.85);
  font-size: 0.95rem;
  text-align: center;
}

.resend-controls {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.resend-button {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  background: rgba(2, 10, 30, 0.45);
  color: rgba(245, 247, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: not-allowed;
  font-size: 0.9rem;
}

.resend-button.enabled {
  background: rgba(255, 179, 0, 0.98);
  color: #031633;
  cursor: pointer;
  border: none;
}

.otp-error {
  margin-top: 0.7rem;
  color: #ff6c6c;
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.otp-not-received-message {
  margin: 0.5rem 0 0;
  color: rgba(245, 247, 255, 0.85);
  font-size: 0.9rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

.helper {
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .otp-screen {
    padding: 1.5rem 1rem;
    padding-top: 2rem;
  }

  .otp-logo {
    width: 180px;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
  }

  .otp-instruction {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .otp-form-wrapper {
    max-width: 100%;
  }

  .otp-input-box,
  .otp-verify {
    width: 320px !important;
    max-width: 92vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .otp-input-box input {
    font-size: 20px;
    height: 52px;
    line-height: 52px;
  }

  .otp-verify {
    height: 52px;
    font-size: 15px;
  }

  .otp-resend-line {
    font-size: 0.9rem;
  }

  .resend-button {
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
  }
}

@media (max-width: 420px) {
  .otp-screen {
    padding: 1.25rem 0.75rem;
    padding-top: 1.5rem;
  }

  .otp-back-button {
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .otp-logo {
    width: 160px;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
  }

  .otp-instruction {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.9rem;
  }

  .otp-label {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .otp-input-box,
  .otp-verify {
    width: 320px !important;
    max-width: 92vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .otp-input-box input {
    font-size: 18px;
    height: 50px;
    line-height: 50px;
    letter-spacing: 0.25em;
  }

  .otp-verify {
    height: 50px;
    font-size: 14px;
    margin-top: 1rem;
  }

  .otp-resend-line {
    font-size: 0.85rem;
    margin-top: 0.75rem;
  }

  .otp-error {
    font-size: 0.85rem;
    margin-top: 0.6rem;
  }

  .otp-not-received-message {
    font-size: 0.85rem;
  }

  .resend-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }
}

@media (max-width: 360px) {
  .otp-screen {
    padding: 1rem 0.5rem;
    padding-top: 1.25rem;
  }

  .otp-logo {
    width: 140px;
    margin-bottom: 1.25rem;
  }

  .otp-instruction {
    font-size: 1rem;
  }

  .otp-input-box,
  .otp-verify {
    width: 320px !important;
    max-width: 92vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .otp-input-box input {
    font-size: 16px;
    height: 48px;
    line-height: 48px;
  }

  .otp-verify {
    height: 48px;
    font-size: 13px;
  }
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 50;
}

.loader-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loader-overlay .logo {
  width: 140px;
  height: auto;
}

.loader-overlay .spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--orange);
  animation: spin 0.9s linear infinite;
}

