/* EasyFlyTrip Admin login - used by Admin/loginpage.php.
   Keep the existing order: theme, layout, branding, form controls, CAPTCHA,
   messages, footer, mobile and short-screen rules.
   Update the stylesheet version in loginpage.php when this file changes.
   Authentication and interactive behavior remain in the PHP page. */
    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    :root {
      --navy: #1e3a5f;
      --navy-dark: #15294a;
      --navy-light: #2a5080;
      --gold: #f59e0b;
      --gold-hover: #d97706;
      --surface: #ffffff;
      --surface-dim: #f1f5f9;
      --text-primary: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --border: #e2e8f0;
      --border-focus: #1e3a5f;
      --error-bg: #fef2f2;
      --error-text: #991b1b;
      --error-border: #fecaca;
      --captcha-bg: #fffbeb;
      --captcha-text: #92400e;
      --captcha-border: #fde68a;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
      --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
      --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e293b 100%);
      padding: 20px;
      position: relative;
      overflow-x: hidden;
      overflow-y: auto;
    }

    /* Subtle pattern overlay */
    body::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 20% 50%, rgba(245,158,11,0.08) 0%, transparent 50%),
                  radial-gradient(circle at 80% 20%, rgba(30,58,95,0.3) 0%, transparent 40%);
      z-index: 0;
    }

    .login-wrapper {
      width: 100%;
      max-width: 420px;
      position: relative;
      z-index: 1;
    }

    /* Top brand bar */
    .brand-bar {
      background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
      border-radius: 20px 20px 0 0;
      padding: 28px 32px 24px;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .brand-bar::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--gold), #fbbf24, var(--gold));
    }

    .logo-bg {
      display: inline-block;
      background: #ffffff;
      padding: 10px 20px;
      border-radius: 12px;
      line-height: 0;
    }

    .brand-bar img {
      height: 42px;
      max-width: 170px;
      object-fit: contain;
    }

    .brand-bar .admin-badge {
      display: inline-block;
      margin-top: 12px;
      padding: 4px 14px;
      background: rgba(245,158,11,0.15);
      border: 1px solid rgba(245,158,11,0.3);
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--gold);
    }

    /* Main card */
    .login-card {
      background: var(--surface);
      border-radius: 0 0 20px 20px;
      padding: 36px 32px 32px;
      box-shadow: var(--shadow-lg);
    }

    .login-card h1 {
      font-size: 22px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
    }

    .login-card .subtitle {
      font-size: 14px;
      color: var(--text-secondary);
      margin-bottom: 28px;
    }

    /* Input fields */
    .form-group {
      position: relative;
      margin-bottom: 18px;
    }

    .form-group label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }

    .input-wrap {
      position: relative;
    }

    .input-wrap svg {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 18px;
      height: 18px;
      color: var(--text-muted);
      pointer-events: none;
    }

    .input-wrap input {
      width: 100%;
      padding: 12px 40px 12px 42px;
      font-size: 16px;
      font-family: inherit;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      background: var(--surface-dim);
      color: var(--text-primary);
      transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
      outline: none;
    }

    .input-wrap input:focus {
      border-color: var(--border-focus);
      background: var(--surface);
      box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
    }

    .input-wrap input::placeholder {
      color: var(--text-muted);
    }

    .password-toggle-btn {
      position: absolute;
      right: 2px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: color 0.2s;
      z-index: 2;
      border-radius: 8px;
    }

    .password-toggle-btn:hover { color: var(--navy); background: var(--surface-dim); }
    .password-toggle-btn svg {
      position: static;
      transform: none;
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }

    /* reCAPTCHA */
    .captcha-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 18px;
    }

    /* Login button */
    .login-btn {
      width: 100%;
      padding: 13px;
      font-size: 15px;
      font-weight: 600;
      font-family: inherit;
      color: #fff;
      background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
      box-shadow: 0 2px 8px rgba(30,58,95,0.25);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .login-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 16px rgba(30,58,95,0.35);
    }

    .login-btn:active {
      transform: translateY(0);
    }

    .login-btn svg { width: 18px; height: 18px; }

    /* Error / warning messages */
    .alert {
      padding: 12px 14px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 500;
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 10px;
      line-height: 1.4;
    }

    .alert svg { width: 18px; height: 18px; flex-shrink: 0; }

    .alert-error {
      background: var(--error-bg);
      color: var(--error-text);
      border: 1px solid var(--error-border);
    }

    .alert-captcha {
      background: var(--captcha-bg);
      color: var(--captcha-text);
      border: 1px solid var(--captcha-border);
    }

    /* Footer */
    .login-footer {
      text-align: center;
      margin-top: 20px;
      font-size: 12px;
      color: rgba(255,255,255,0.72);
    }

    /* Mobile: compact card with room for the scaled CAPTCHA at 320px.
       Keep the widget's natural width and scale from its center. */
    @media (max-width: 480px) {
      body { padding: 16px 12px; }
      .login-wrapper { max-width: 100%; }
      .brand-bar { padding: 18px 16px 14px; }
      .brand-bar img { height: 34px; }
      .logo-bg { padding: 8px 16px; }
      .brand-bar .admin-badge { margin-top: 10px; }
      .login-card { padding: 22px 16px 24px; }
      .login-card h1 { font-size: 20px; }
      .login-card .subtitle { margin-bottom: 20px; line-height: 1.5; }
      .form-group { margin-bottom: 16px; }
      .input-wrap input { min-height: 46px; }
      .password-toggle-btn { width: 40px; height: 40px; }
      .captcha-wrap { height: 62px; margin-bottom: 14px; }
      .captcha-wrap .g-recaptcha {
        flex: 0 0 304px;
        transform: scale(0.78);
        transform-origin: top center;
      }
      .login-btn { min-height: 46px; }
      .login-footer { margin-top: 16px; line-height: 1.5; }
    }
    /* Short desktop windows and mobile keyboards must not clip the form. */
    @media (max-height: 760px) {
      body { align-items: flex-start; }
    }
  