* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1B3A5C;
  --primary-light: #2A5580;
  --primary-dark: #0F2640;
  --accent: #E8A838;
  --accent-light: #F0C060;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --text: #1A1D21;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F0F1F3;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --error-border: #FECACA;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  height: 72px;
  width: auto;
  object-fit: contain;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.1);
}

.input-icon {
  color: var(--text-tertiary);
  font-size: 22px;
  flex-shrink: 0;
}

.login-input {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  padding: 16px 0;
  outline: none;
  min-width: 0;
}

.login-input::placeholder {
  color: var(--text-tertiary);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
}

.login-btn:hover {
  background: var(--primary-light);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.message-box {
  text-align: center;
  padding: 24px 20px;
  border-radius: var(--radius);
  margin-top: 4px;
}

.message-box.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.message-box.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}

.message-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.message-box.success .message-icon {
  color: var(--success);
}

.message-box.error .message-icon {
  color: var(--error);
}

.message-box h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.message-box p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.try-again-btn {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.15s;
}

.try-again-btn:hover {
  background: rgba(27, 58, 92, 0.06);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 24px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.back-link:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

.back-link .material-icons-outlined {
  font-size: 18px;
}

.dev-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}

.dev-divider::before,
.dev-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dev-divider span {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.dev-login-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}

.dev-login-btn:hover {
  background: #d49530;
}

.dev-login-btn:active {
  transform: scale(0.98);
}

.dev-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.dev-spinner {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

.dev-btn-group {
  display: flex;
  gap: 10px;
}

.dev-btn-group .dev-login-btn {
  flex: 1;
  font-size: 13px;
  padding: 12px 8px;
  min-height: 46px;
}

.dev-super-btn {
  background: #7C3AED !important;
}

.dev-super-btn:hover {
  background: #6D28D9 !important;
}

.passkey-prompt-header {
  text-align: center;
  margin-bottom: 24px;
}

.passkey-prompt-icon {
  font-size: 48px;
  color: var(--primary);
  display: block;
  margin-bottom: 12px;
}

.passkey-prompt-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.passkey-prompt-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.passkey-prompt-alt {
  text-align: center;
  margin-top: 16px;
}

.passkey-code-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.15s;
}

.passkey-code-link:hover {
  background: rgba(27, 58, 92, 0.06);
}

.passkey-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, transform 0.12s;
  text-align: left;
  position: relative;
  margin-bottom: 0;
}

.passkey-btn:hover {
  background: var(--primary-light);
}

.passkey-btn:active {
  transform: scale(0.98);
}

.passkey-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.passkey-btn-icon {
  font-size: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.passkey-btn-content {
  flex: 1;
}

.passkey-btn-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.passkey-btn-sub {
  display: block;
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

.passkey-btn-arrow {
  font-size: 20px;
  opacity: 0.5;
  flex-shrink: 0;
}

.passkey-btn-loader {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (max-width: 480px) {
  .login-page {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 60px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .login-logo img {
    height: 60px;
  }

  .login-title {
    font-size: 20px;
  }
}
