/* ============================================
   Login CSS — Professional Branch Login Page
   ============================================ */

/* --- CSS Variables (Theme) --- */
:root {
  --primary: #16a34a;
  --primary-dark: #0f7a36;
  --primary-light: #22c55e;
  --primary-gradient: linear-gradient(135deg, #16a34a, #22c55e);

  --bg-start: #0b1f14;
  --bg-end: #1a3a28;

  --card-bg: rgba(255, 255, 255, 0.97);
  --card-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  --card-radius: 20px;

  --text: #1a2e22;
  --text-muted: #6b7b73;
  --text-white: #ffffff;

  --input-bg: #f8faf9;
  --input-border: #d1d9d4;
  --input-focus: #16a34a;
  --input-radius: 12px;

  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #b91c1c;

  --font: "Plus Jakarta Sans", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --theme-navy: #141c28;
  --theme-navy-dark: #0d131c;
  --theme-cream: #FEF7E5;
  --theme-card-bg: #FAF6EE;
  --theme-card-border: rgba(220, 214, 200, 0.7);
  --theme-text-dark: #111827;
  --theme-text-muted: #64748b;
  --theme-text-light: #94a3b8;
  --theme-input-border: #e2ded5;
  --theme-input-focus: #111827;
}

/* --- Base Body for Split Login Page --- */
body.login-page-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  display: block;
  overflow-x: hidden;
  background-color: var(--theme-cream);
  font-family: var(--font);
  color: var(--theme-text-dark);
}

body.login-page-body::before,
body.login-page-body::after {
  display: none !important;
}

/* --- Split Layout Container --- */
.login-split-layout {
  min-height: 100vh;
  width: 100%;
  display: flex;
  background-color: var(--theme-cream);
  background-image: url('../images/login-bg.png');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  position: relative;
  overflow-x: hidden;
}

/* --- Left Hero Pane --- */
.login-hero-pane {
  flex: 0 0 52%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 40px 60px 10%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 440px;
}

.hero-title {
  font-size: clamp(32px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin: 0 0 16px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-description {
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
  color: #94a3b8;
  margin: 0;
  font-weight: 400;
  max-width: 400px;
}

/* --- Right Form Pane --- */
.login-form-pane {
  flex: 0 0 48%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

/* --- Grill Wireframe Accents --- */
.grill-accent {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  user-select: none;
}

.grill-accent-tl {
  top: calc(50% - 310px);
  left: calc(50% - 240px);
}

.grill-accent-br {
  top: calc(50% - 130px);
  right: calc(50% - 250px);
}

/* --- Card Container & Card --- */
.login-card-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 3;
}

.admin-login-card {
  width: 100%;
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-card-border);
  border-radius: 18px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.08), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 34px 36px 36px;
  box-sizing: border-box;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Status Pill in Card */
.card-status-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #edf7ee;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.1px;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  display: inline-block;
  animation: pulseDot 2.5s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Card Header Block */
.card-header-block {
  margin-bottom: 24px;
}

.card-main-title {
  font-size: 29px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 6px 0;
}

.card-subtitle-text {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

/* Alert Notification Messages */
.admin-login-card .error-message,
.admin-login-card .success-message {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-login-card .error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.admin-login-card .success-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Form Structure */
.admin-auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.field-label-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.forgot-pass-link {
  font-size: 12px;
  font-weight: 500;
  color: #a06e3d;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.forgot-pass-link:hover {
  color: #7c4f24;
  text-decoration: underline;
}

.input-control-box {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.form-text-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  background: #ffffff;
  border: 1px solid var(--theme-input-border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.input-control-box:has(.field-action-btn) .form-text-input {
  padding-right: 42px;
}

.form-text-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.form-text-input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.input-control-box:focus-within .field-icon-prefix {
  color: #111827;
}

.field-action-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.field-action-btn:hover {
  color: #374151;
}

/* Checkbox Row */
.checkbox-container-row {
  margin-top: -2px;
  margin-bottom: 2px;
}

.checkbox-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.form-checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  margin: 0;
}

.form-checkbox-input::before {
  content: "";
  width: 9px;
  height: 9px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  background-color: #ffffff;
  transition: transform 0.1s ease-in-out;
}

.form-checkbox-input:checked {
  background-color: #111827;
  border-color: #111827;
}

.form-checkbox-input:checked::before {
  transform: scale(1);
}

.form-checkbox-input:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.checkbox-caption {
  font-size: 13px;
  color: #4b5563;
  font-weight: 400;
}

/* Submit Button */
.auth-primary-btn {
  width: 100%;
  height: 48px;
  background-color: #151c28;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(21, 28, 40, 0.18);
  margin-top: 4px;
}

.auth-primary-btn:hover {
  background-color: #1f293d;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(21, 28, 40, 0.26);
}

.auth-primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(21, 28, 40, 0.18);
}

.btn-arrow-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.auth-primary-btn:hover .btn-arrow-icon {
  transform: translate(2px, -2px);
}

/* Footer Notice */
.auth-footer-notice {
  margin-top: 28px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
  font-weight: 400;
}

/* Recovery Page Specific Styles */
.recovery-callout-card {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: #854d0e;
}

.recovery-callout-card.info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.recovery-callout-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
}

.recovery-callout-text {
  flex: 1;
}

.recovery-subnav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px 0 16px 0;
  padding-bottom: 4px;
}

.recovery-alt-action {
  font-size: 12.5px;
  font-weight: 600;
  color: #a06e3d;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.recovery-alt-action:hover {
  color: #7c4f24;
  text-decoration: underline;
}

.auth-back-link-wrapper {
  margin-top: 22px;
  text-align: center;
}

.auth-back-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.auth-back-action-link:hover {
  background: rgba(0, 0, 0, 0.07);
  color: #111827;
  transform: translateX(-2px);
}

/* Floating Help Button (?) */
.floating-help-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #1c222b;
  color: #ffffff;
  border: none;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 100;
}

.floating-help-trigger:hover {
  background-color: #2c3545;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.help-popup-dialog {
  position: fixed;
  bottom: 74px;
  right: 24px;
  width: 320px;
  background: #ffffff;
  border: 1px solid #e2ded5;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  z-index: 101;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  animation: fadeIn 0.2s ease-out;
}

.help-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.help-popup-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.help-popup-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
}

.help-popup-close:hover {
  color: #0f172a;
}

/* --- Responsive Adjustments --- */
@media (max-width: 960px) {
  .login-split-layout {
    flex-direction: column;
    background-size: cover;
    background-position: top center;
  }

  .login-hero-pane {
    flex: 0 0 auto;
    min-height: auto;
    padding: 48px 24px 32px;
    justify-content: center;
    text-align: center;
    background-color: #141c28;
  }

  .hero-content {
    margin-left: 0;
  }

  .login-form-pane {
    flex: 1 0 auto;
    min-height: auto;
    padding: 32px 20px 48px;
    background-color: var(--theme-cream);
  }

  .grill-accent {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-hero-pane {
    padding: 32px 16px 20px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-description {
    font-size: 14px;
  }

  .login-form-pane {
    padding: 20px 12px 36px;
  }

  .admin-login-card {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .card-main-title {
    font-size: 22px;
  }

  .form-text-input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  .floating-help-trigger {
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .help-popup-dialog {
    right: 16px;
    bottom: 60px;
    width: calc(100vw - 32px);
  }
}

/* --- Keep Legacy / Recovery Page Styles Unaffected --- */
body:not(.login-page-body) {
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  position: relative;
  overflow: hidden;
}

body.recovery-page {
  align-items: flex-start;
  overflow-y: auto;
}

body.recovery-page .login-container {
  margin: auto 0;
}

/* --- Animated Background Pattern --- */
body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(22, 163, 74, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(21, 128, 61, 0.05) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes bgShift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(-5%, 5%) rotate(3deg);
  }
}

/* --- Floating decorative circles --- */
body::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.06), transparent 70%);
  top: 10%;
  right: 5%;
  z-index: 0;
  animation: floatCircle 15s ease-in-out infinite alternate;
}

@keyframes floatCircle {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -30px) scale(1.1); }
}

/* --- Login Card Container --- */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Login Card --- */
.login-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 44px 36px 38px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Branding / Logo Area --- */
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 30px;
  color: white;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25);
}

.login-brand h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.login-brand p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* --- Divider --- */
.login-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--input-border), transparent);
  margin: 0 0 28px;
}

/* --- Form --- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Input Groups --- */
.input-group {
  position: relative;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.input-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.input-group input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 2px solid var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.input-group input::placeholder {
  color: #aab7b1;
  font-weight: 400;
}

.input-group input:focus {
  border-color: var(--input-focus);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.input-group input:focus ~ .input-icon,
.input-group input:focus + .input-icon {
  color: var(--primary);
  opacity: 1;
}

/* --- Error Message --- */
.error-message {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 16px;
  border-radius: var(--input-radius);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: shakeError 0.4s ease-in-out;
}

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

.error-message:empty {
  display: none;
}

.success-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--input-radius);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* --- Submit Button --- */
.login-btn {
  width: 100%;
  padding: 15px 20px;
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--input-radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.15s ease;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35);
  filter: brightness(1.05);
}

.login-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

/* --- Footer --- */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

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

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

.login-recovery-link {
  margin-top: 14px;
  text-align: right;
  font-size: 13px;
}

.login-recovery-link a,
.recovery-back-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.login-recovery-link a:hover,
.recovery-back-link:hover {
  text-decoration: underline;
}

.recovery-copy {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: -10px 0 18px;
  text-align: center;
}

.recovery-back-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }

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

  .login-brand .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .login-brand h1 {
    font-size: 19px;
  }

  .login-form {
    gap: 16px;
  }

  .input-group input {
    padding: 13px 14px 13px 42px;
    font-size: 13px;
  }

  .login-btn {
    padding: 13px 16px;
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 24px 18px 22px;
  }

  .login-brand h1 {
    font-size: 17px;
  }
}
