/* ==========================================================================
   Saara Spaces Admin Portal - Executive Sign-In CSS (login.css)
   Universal Admin UI/UX Standard: High Visual Polish, WCAG 2.1 AA Compliant,
   Architectural Spruce Teal (#065f61) & Champagne Gold (#c5a880) Aesthetics.
   ========================================================================== */

:root {
  /* Surface & Background */
  --color-bg-body: #f8fafc;
  --color-bg-surface: #ffffff;
  --color-bg-subtle: #f1f5f9;
  --color-border-subtle: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-border-focus: #065f61;

  /* Typography Colors */
  --color-text-main: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  /* Brand Signature Tokens - Saara Spaces Client Palette */
  --saara-teal: #065f61;
  --saara-teal-dark: #04484a;
  --saara-teal-light: #087375;
  --saara-teal-subtle: #eef7f7;
  --saara-teal-border: #b5dede;
  --saara-gold: #c5a880;
  --saara-gold-light: #f9f5ee;
  --saara-gold-border: #e2d1bb;
  --saara-dark-bg: #051415;

  /* Semantic Feedback */
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;

  /* Dimensions & Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-card: 0 20px 40px -15px rgba(6, 95, 97, 0.12), 0 0 0 1px rgba(6, 95, 97, 0.06);
  --shadow-focus: 0 0 0 3.5px rgba(6, 95, 97, 0.18);

  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-family-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Luxury Ambient Background Glow & Subtle Grid */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle 600px at 50% -100px, rgba(6, 95, 97, 0.12), transparent 70%),
    radial-gradient(circle 500px at 80% 90%, rgba(197, 168, 128, 0.08), transparent 70%),
    linear-gradient(to right, rgba(226, 232, 240, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.45) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  z-index: -1;
  pointer-events: none;
}

/* Outer Wrapper */
.auth-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* Header & Brand Identity */
.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0a7779 0%, #065f61 55%, #034143 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(6, 95, 97, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(197, 168, 128, 0.5);
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
  background: linear-gradient(135deg, #051415 0%, #065f61 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
  line-height: 1.25;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-width: 390px;
}

/* Main Authentication Card */
.auth-card {
  background-color: var(--color-bg-surface);
  border: 1px solid rgba(6, 95, 97, 0.14);
  border-radius: var(--radius-xl);
  padding: 34px 30px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Card Top Gold Accent Line */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--saara-teal) 0%, var(--saara-gold) 50%, var(--saara-teal) 100%);
}

/* Alert Banners */
.alert-banner {
  display: none;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 12.5px;
  line-height: 1.45;
  transition: all 0.2s ease;
}

.alert-banner.active {
  display: flex;
  animation: slideDown 0.25s ease-out;
}

.alert-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 13px;
}

/* Danger Alert */
.alert-danger {
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: #991b1b;
}

.alert-danger .alert-icon {
  color: var(--color-danger);
}

/* Warning Alert */
.alert-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: #92400e;
}

.alert-warning .alert-icon {
  color: var(--color-warning);
}

/* Success Alert */
.alert-success {
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: #166534;
}

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

/* Form Groups */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.required-asterisk {
  color: var(--color-danger);
  margin-left: 3px;
}

/* Input Wrappers & Controls */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-prefix {
  position: absolute;
  left: 13px;
  color: var(--color-text-muted);
  width: 17px;
  height: 17px;
  pointer-events: none;
  transition: color 0.18s ease;
  z-index: 2;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  background-color: #f8fafc;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-text-main);
  transition: all 0.18s ease;
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-input:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.form-input:focus {
  outline: none;
  border-color: var(--saara-teal);
  background-color: #ffffff;
  box-shadow: var(--shadow-focus);
}

.input-wrapper:focus-within .input-icon-prefix {
  color: var(--saara-teal);
}

.form-input.has-error {
  border-color: var(--color-danger);
  background-color: #fffbfa;
}

.form-input.has-error:focus {
  box-shadow: 0 0 0 3.5px rgba(220, 38, 38, 0.15);
}

/* Password Toggle Button */
.btn-password-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease;
  z-index: 2;
}

.btn-password-toggle:hover {
  color: var(--color-text-main);
}

.btn-password-toggle:focus-visible {
  outline: 2px solid var(--saara-teal);
  outline-offset: 1px;
}

.form-error-msg {
  display: none;
  font-size: 11.5px;
  color: var(--color-danger);
  font-weight: 500;
  margin-top: 3px;
}

.form-error-msg.visible {
  display: block;
}

/* Row for Remember Me & Forgot Password */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 12.5px;
}

.remember-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--color-text-secondary);
}

.remember-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--saara-teal);
  cursor: pointer;
  border-radius: 4px;
}

/* Primary Submit Button */
.btn-submit {
  width: 100%;
  height: 46px;
  background: linear-gradient(180deg, #076d6f 0%, var(--saara-teal) 100%);
  color: #ffffff;
  border: 1px solid #04484a;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(6, 95, 97, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  background: #087375;
  border-color: #055557;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 95, 97, 0.45);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
  background: #04484a;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-submit:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Button Loading Spinner */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.btn-submit.loading .spinner {
  display: inline-block;
}

.btn-submit.loading .btn-text,
.btn-submit.loading svg {
  display: none;
}

/* Quick Fill Demo Chip */
.quick-fill-chip {
  margin-top: 18px;
  padding: 9px 12px;
  background: var(--saara-teal-subtle);
  border: 1px dashed var(--saara-teal-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--saara-teal);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.quick-fill-chip:hover {
  background: #d8eded;
  border-color: var(--saara-teal);
}

.quick-fill-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-fill-action {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(6, 95, 97, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Security Trust Footer */
.auth-trust-footer {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-trust-dot {
  width: 3px;
  height: 3px;
  background: #cbd5e1;
  border-radius: 50%;
}

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-card.shake {
  animation: shake 0.35s ease-in-out;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: 26px 20px;
    border-radius: var(--radius-lg);
  }
  .auth-title {
    font-size: 21px;
  }
}
