/* ============================================
   AUTHENTICATION PAGE STYLES
   ============================================ */

/* Override body layout for auth pages to ensure proper flexbox */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px circle at 20% -20%, rgba(0, 0, 0, 0.06), transparent 55%),
              radial-gradient(900px circle at 110% 10%, rgba(0, 0, 0, 0.04), transparent 55%),
              var(--color-bg-light);
}

/* Main content area should grow and allow scrolling */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: transparent;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-2);
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

@media (min-width: 480px) {
  .auth-container {
    padding: var(--space-6) var(--space-2);
  }
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  margin: var(--space-4) auto var(--space-4) auto;
}

@media (min-width: 480px) {
  .auth-card {
    padding: var(--space-8);
    max-width: 440px;
  }
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}


.auth-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--space-2) 0;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  text-rendering: optimizeLegibility;
}

@media (min-width: 480px) {
  .auth-title {
    font-size: 32px;
  }
}

.auth-subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 28ch;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 480px) {
  .auth-subtitle {
    font-size: var(--font-body-mobile);
  }
}

.auth-form {
  margin-top: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}

@media (min-width: 480px) {
  .form-label {
    font-size: var(--font-body-mobile);
  }
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 200ms ease;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--color-text-primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.05);
}

.form-hint {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

.form-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.link-button {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.code-input {
  text-align: center;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
}

.email-inline {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.resend-row {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.muted {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

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

.form-input:disabled {
  background: var(--color-bg-lighter);
  cursor: not-allowed;
  opacity: 0.6;
}

.form-error {
  display: none;
  font-size: 13px;
  color: #dc2626;
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fecaca;
  gap: 10px;
  align-items: flex-start;
}

.form-error.show {
  display: flex;
}

.form-error-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #dc2626;
  flex: 0 0 auto;
  margin-top: 1px;
}

.form-success {
  display: none;
  font-size: 14px;
  color: #047857;
  margin-top: var(--space-2);
  padding: 12px 16px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  align-items: flex-start;
  gap: 10px;
  animation: fadeIn 0.2s ease-in;
}

.form-success.show {
  display: flex;
}

.form-success-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  margin-top: 1px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-success-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.form-success-body {
  color: var(--color-text-secondary);
}

.btn-submit {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-bg-white);
  background: var(--color-text-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease;
  letter-spacing: -0.01em;
  margin-top: var(--space-4);
  -webkit-appearance: none;
  appearance: none;
}

.btn-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-icon {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

@media (min-width: 480px) {
  .btn-submit {
    font-size: var(--font-body-mobile);
    padding: 14px 24px;
  }
}

.btn-submit:hover:not(:disabled) {
  background: #1a1a1a;
}

.btn-submit:active:not(:disabled) {
  background: var(--color-text-primary);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-submit.loading {
  position: relative;
}

.btn-submit.loading .btn-content {
  opacity: 0;
}

.btn-submit.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid var(--color-bg-white);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

.auth-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

@media (min-width: 480px) {
  .auth-footer {
    font-size: var(--font-small);
  }
}

.auth-footer p {
  margin: 0;
}

.auth-footer a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: var(--space-4) 0;
  text-align: center;
}

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

.divider-text {
  padding: 0 var(--space-3);
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.btn-microsoft {
  display: block;
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-text-primary);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 200ms ease;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 480px) {
  .btn-microsoft {
    font-size: var(--font-body-mobile);
    padding: 14px 24px;
  }
}

.btn-microsoft:hover {
  background: var(--color-bg-lighter);
  border-color: var(--color-text-primary);
}

.btn-microsoft:active {
  background: var(--color-bg-white);
}

