/**
 * CHITRASA — Photographer Login Styles v3.2.0
 * Location: /public_html/css/login.css
 *
 * SECURITY COMPLIANCE:
 * ─────────────────────────────────────────────────────
 * OWASP A05  All styling externalized; zero inline styles
 * OWASP A03  No url() injection vectors; static values only
 * NIST SP 800-53 SC-18  No executable content in CSS
 * ─────────────────────────────────────────────────────
 *
 * DESIGN TOKENS:
 * ─ Background:  #F4F3EF (warm parchment)
 * ─ Primary:     #4A5A3C (olive green)
 * ─ Accent:      #C5A649 (gold)
 * ─ Corners:     Sharp (0) everywhere EXCEPT pill header
 * ─ Fonts:       Grafik (headings) / DM Sans (body)
 */

:root {
  --clr-bg:          #F4F3EF;
  --clr-surface:     #FFFFFF;
  --clr-primary:     #4A5A3C;
  --clr-primary-dk:  #3B4A30;
  --clr-primary-lt:  #5C6E4A;
  --clr-gold:        #C5A649;
  --clr-gold-dk:     #A8892F;
  --clr-text:        #2C2C2C;
  --clr-text-mid:    #555555;
  --clr-text-muted:  #6B6B6B;
  --clr-text-light:  #9A9A9A;
  --clr-border:      #DEDCD6;
  --clr-border-focus:#4A5A3C;
  --clr-error:       #B33A3A;
  --clr-error-bg:    #FDF2F2;
  --clr-success:     #2E7D3A;
  --clr-success-bg:  #EEF7EF;

  --ff-heading: 'Grafik', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;

  --radius-none: 0;
  --radius-pill: 9999px;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
  --shadow-hover:0 4px 16px rgba(0,0,0,0.08);
  --shadow-focus:0 0 0 3px rgba(74,90,60,0.2);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-med:  250ms;
}


/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-body);
  font-weight: var(--fw-regular);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ========================================================================
   PILL HEADER — Oval pill shape (REQUIRED on every frontend file)
   ======================================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: transparent;
  position: relative;
  z-index: 10;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border-radius: var(--radius-pill);
  color: var(--clr-text);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
  user-select: none;
}

.header-pill:hover {
  background: rgba(74,90,60,0.06);
}

.header-pill__logo {
  width: 55px;
  height: 55px;
  flex-shrink: 0;
  object-fit: contain;
}

.header-pill__wordmark {
  font-family: var(--ff-heading);
  font-weight: var(--fw-bold);
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Chitra = white, hyphen = white, SA = gold — matches admin dashboard */
.wordmark-chitra { color: var(--clr-primary); }
.wordmark-sa     { color: var(--clr-gold); }

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--clr-text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: var(--fw-medium);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.header-back:hover {
  color: var(--clr-primary);
  background: rgba(74,90,60,0.06);
}

.header-back svg { flex-shrink: 0; }


/* === LAYOUT === */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.auth-container { width: 100%; max-width: 440px; }

.auth-card {
  background: var(--clr-surface);
  border-radius: var(--radius-none);
  box-shadow: var(--shadow-card);
  padding: 40px 32px 36px;
}

.auth-header { text-align: center; margin-bottom: 28px; }

.auth-title {
  font-family: var(--ff-heading);
  font-weight: var(--fw-bold);
  font-size: 1.55rem;
  color: var(--clr-text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--clr-text-muted);
}


/* === ALERTS === */
.alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  line-height: 1.45;
  border-left: 3px solid transparent;
  animation: alertIn var(--dur-med) var(--ease-out);
}

.alert.show { display: flex; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert span { flex: 1; }

.alert-error {
  background: var(--clr-error-bg);
  color: var(--clr-error);
  border-left-color: var(--clr-error);
}

.alert-success {
  background: var(--clr-success-bg);
  color: var(--clr-success);
  border-left-color: var(--clr-success);
}

.alert-warning {
  background: #FFF8E6;
  color: #7A6200;
  border-left-color: #C5A649;
}

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


/* === ROLE SELECTOR === */
.role-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.role-option { cursor: pointer; }

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.role-card {
  padding: 14px 8px;
  text-align: center;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-none);
  background: var(--clr-surface);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}

.role-card:hover {
  border-color: var(--clr-primary-lt);
  background: rgba(74,90,60,0.02);
}

.role-option input:checked + .role-card {
  border-color: var(--clr-primary);
  background: rgba(74,90,60,0.04);
  box-shadow: 0 0 0 1px var(--clr-primary);
}

.role-option input:focus-visible + .role-card {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.role-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
}

.role-icon svg {
  width: 22px;
  height: 22px;
  color: var(--clr-text-muted);
  stroke-width: 1.8;
}

.role-option input:checked + .role-card .role-icon svg {
  color: var(--clr-primary);
}

.role-title {
  font-size: 0.82rem;
  font-weight: var(--fw-semi);
  color: var(--clr-text);
  margin-bottom: 2px;
}

.role-desc {
  font-size: 0.72rem;
  color: var(--clr-text-light);
}


/* === SOCIAL BUTTON === */
.btn-social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-none);
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: var(--fw-medium);
  color: var(--clr-text);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}

.btn-social:hover:not(:disabled) {
  border-color: var(--clr-text-muted);
  background: #FAFAF8;
  box-shadow: var(--shadow-sm);
}

.btn-social:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-social svg { flex-shrink: 0; }


/* === DIVIDER === */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
}

.divider-line { flex: 1; height: 1px; background: var(--clr-border); }

.divider-text {
  font-size: 0.78rem;
  color: var(--clr-text-light);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* === FORM ELEMENTS === */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: var(--clr-text);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-none);
  font-family: var(--ff-body);
  font-size: 0.88rem;
  color: var(--clr-text);
  background: var(--clr-surface);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.form-input::placeholder { color: var(--clr-text-light); }
.form-input:focus { border-color: var(--clr-border-focus); box-shadow: var(--shadow-focus); }
.form-input:disabled { opacity: 0.55; cursor: not-allowed; background: #F9F9F7; }


/* === PASSWORD === */
.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 44px; }

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text-light);
  padding: 4px;
  display: flex;
  transition: color var(--dur-fast);
}

.password-toggle:hover { color: var(--clr-text-mid); }
.password-toggle .eye-hide { display: none; }
.password-toggle .eye-show { display: block; }
.password-wrapper.visible .password-toggle .eye-show { display: none; }
.password-wrapper.visible .password-toggle .eye-hide { display: block; }


/* === FORM ROW === */
.form-row { display: flex; justify-content: flex-end; margin-bottom: 4px; }

.forgot-link {
  color: var(--clr-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  transition: color var(--dur-fast);
}

.forgot-link:hover { color: var(--clr-primary-dk); text-decoration: underline; }


/* === BUTTONS === */
.btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-none);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: var(--fw-semi);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  position: relative;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--clr-primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--clr-primary); color: #FFFFFF; }
.btn-primary:hover:not(:disabled) { background: var(--clr-primary-dk); box-shadow: var(--shadow-hover); }

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .btn-text { opacity: 0; }
.btn.loading .btn-spinner { display: block; position: absolute; }

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

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--clr-gold);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-none);
  font-family: var(--ff-body);
  font-size: 0.88rem;
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}

.btn-gold:hover { background: var(--clr-gold-dk); box-shadow: var(--shadow-hover); }
.btn-gold svg { flex-shrink: 0; }


/* === FOOTER LINKS === */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--clr-border);
}

.auth-footer-text { font-size: 0.84rem; color: var(--clr-text-muted); }

.auth-footer-link {
  color: var(--clr-primary);
  text-decoration: none;
  font-weight: var(--fw-medium);
  transition: color var(--dur-fast);
}

.auth-footer-link:hover { color: var(--clr-primary-dk); text-decoration: underline; }


/* === SITE FOOTER === */
.footer { text-align: center; padding: 16px 24px 24px; }
.footer-text { font-size: 0.76rem; color: var(--clr-text-light); }


/* === RESPONSIVE === */
@media (max-width: 480px) {
  .header { padding: 12px 16px; }
  .header-pill { padding: 8px 18px; }
  .header-pill__wordmark { font-size: 0.88rem; }
  .header-back { font-size: 0.78rem; padding: 6px 10px; }
  .auth-card { padding: 28px 20px 24px; box-shadow: none; border-top: 1px solid var(--clr-border); }
  .auth-title { font-size: 1.35rem; }
  .role-selector { gap: 6px; }
  .role-card { padding: 10px 6px; }
  .role-title { font-size: 0.76rem; }
  .role-desc { font-size: 0.68rem; }
}

@media (max-width: 340px) {
  .role-selector { grid-template-columns: 1fr; gap: 6px; }
  .role-card { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; }
  .role-icon { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print { .main, .footer { display: none; } }