/* ==========================================================================
   NN Studio Photo — Login
   Design language: camera viewfinder / aperture, dark-room premium
   ========================================================================== */

   @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

   :root {
     /* ---- Dark theme (default) ---- */
     --bg: #0a0a0c;
     --bg-glow-1: #ff7a1a;
     --bg-glow-2: #2a1a3a;
     --surface: #15151a;
     --surface-raised: #1c1c22;
     --border: rgba(255, 255, 255, 0.09);
     --border-strong: rgba(255, 255, 255, 0.16);
     --text: #f3efe6;
     --text-muted: #9a9aa3;
     --text-faint: #5c5c66;
     --accent: #ff7a1a;
     --accent-soft: #ffb27a;
     --accent-contrast: #14100b;
     --danger: #ff5c5c;
     --danger-bg: rgba(255, 92, 92, 0.1);
     --danger-border: rgba(255, 92, 92, 0.3);
     --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.65);
     --grain-opacity: 0.05;
   
     --font-display: 'Oswald', 'Arial Narrow', sans-serif;
     --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
     --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
   
     color-scheme: dark;
   }
   
   [data-theme="light"] {
     --bg: #f2f0ea;
     --bg-glow-1: #ff7a1a;
     --bg-glow-2: #ffd9b0;
     --surface: #ffffff;
     --surface-raised: #fbfaf7;
     --border: rgba(20, 16, 11, 0.1);
     --border-strong: rgba(20, 16, 11, 0.18);
     --text: #17140f;
     --text-muted: #605c53;
     --text-faint: #9c968a;
     --accent: #e8630a;
     --accent-soft: #ff9a4d;
     --accent-contrast: #fff8f0;
     --danger: #c93b3b;
     --danger-bg: rgba(201, 59, 59, 0.08);
     --danger-border: rgba(201, 59, 59, 0.25);
     --shadow: 0 30px 70px -25px rgba(30, 20, 10, 0.25);
     --grain-opacity: 0.03;
   
     color-scheme: light;
   }
   
   * {
     box-sizing: border-box;
   }
   
   html,
   body {
     margin: 0;
     padding: 0;
     min-height: 100%;
   }
   
   body {
     background: var(--bg);
     font-family: var(--font-body);
     color: var(--text);
     -webkit-font-smoothing: antialiased;
     transition: background-color 0.4s ease, color 0.4s ease;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Page shell                                                             */
   /* ---------------------------------------------------------------------- */
   
   .login-page {
     position: relative;
     min-height: 100svh;
     display: flex;
     align-items: center;
     justify-content: center;
     overflow: hidden;
     padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
   }
   
   /* soft studio light-leak, drifting slowly behind the card */
   .light-leak {
     position: absolute;
     inset: -20%;
     pointer-events: none;
     background:
       radial-gradient(38% 32% at 18% 15%, color-mix(in srgb, var(--bg-glow-1) 30%, transparent) 0%, transparent 70%),
       radial-gradient(45% 40% at 85% 88%, color-mix(in srgb, var(--bg-glow-2) 55%, transparent) 0%, transparent 70%);
     filter: blur(10px);
     animation: drift 22s ease-in-out infinite alternate;
     z-index: 0;
   }
   
   @keyframes drift {
     0% { transform: translate(0, 0) scale(1); }
     100% { transform: translate(-2%, 3%) scale(1.06); }
   }
   
   /* fine film-grain texture over everything */
   .grain-overlay {
     position: fixed;
     inset: 0;
     pointer-events: none;
     z-index: 5;
     opacity: var(--grain-opacity);
     mix-blend-mode: overlay;
     background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
   }
   
   /* legacy hooks kept harmless (unused blobs from old markup, if present) */
   .login-bg-circle {
     display: none;
   }
   
   .login-container {
     position: relative;
     z-index: 2;
     width: 100%;
     max-width: 420px;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 28px;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Theme toggle                                                           */
   /* ---------------------------------------------------------------------- */
   
   .theme-toggle {
     position: absolute;
     top: 18px;
     right: 18px;
     z-index: 10;
     width: 42px;
     height: 42px;
     border-radius: 50%;
     border: 1px solid var(--border);
     background: var(--surface);
     color: var(--text-muted);
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
   }
   
   .theme-toggle:hover {
     color: var(--accent);
     border-color: var(--border-strong);
   }
   
   .theme-toggle:active {
     transform: scale(0.92);
   }
   
   .theme-toggle i {
     font-size: 15px;
   }
   
   .theme-toggle .icon-sun { display: none; }
   [data-theme="light"] .theme-toggle .icon-moon { display: none; }
   [data-theme="light"] .theme-toggle .icon-sun { display: inline; }
   
   /* ---------------------------------------------------------------------- */
   /* Brand header — viewfinder lockup                                       */
   /* ---------------------------------------------------------------------- */
   
   .login-brand {
     display: flex;
     flex-direction: column;
     align-items: center;
     text-align: center;
     gap: 6px;
   }
   
   .viewfinder-logo {
     position: relative;
     width: 84px;
     height: 84px;
     margin-bottom: 14px;
     display: flex;
     align-items: center;
     justify-content: center;
   }
   
   .viewfinder-logo img {
     width: 46px;
     height: 46px;
     object-fit: contain;
     position: relative;
     z-index: 2;
     filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
   }
   
   .viewfinder-logo .vf-corner {
     position: absolute;
     width: 18px;
     height: 18px;
     border: 2px solid var(--accent);
     opacity: 0.9;
   }
   
   .viewfinder-logo .vf-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
   .viewfinder-logo .vf-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
   .viewfinder-logo .vf-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
   .viewfinder-logo .vf-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
   
   .viewfinder-logo .vf-ring {
     position: absolute;
     inset: 12px;
     border: 1px solid var(--border-strong);
     border-radius: 50%;
   }
   
   .brand-eyebrow {
     font-family: var(--font-mono);
     font-size: 10.5px;
     letter-spacing: 0.24em;
     color: var(--accent);
     text-transform: uppercase;
   }
   
   .login-brand h1 {
     font-family: var(--font-display);
     font-weight: 600;
     font-size: 27px;
     letter-spacing: 0.01em;
     margin: 4px 0 0;
     color: var(--text);
   }
   
   .login-brand p {
     margin: 2px 0 0;
     font-size: 13px;
     color: var(--text-muted);
   }
   
   /* ---------------------------------------------------------------------- */
   /* Login card                                                             */
   /* ---------------------------------------------------------------------- */
   
   .login-card {
     position: relative;
     width: 100%;
     background: var(--surface);
     border: 1px solid var(--border);
     border-radius: 20px;
     padding: 30px 26px 26px;
     box-shadow: var(--shadow);
     animation: focus-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
   }
   
   @keyframes focus-in {
     from {
       opacity: 0;
       transform: translateY(10px) scale(0.99);
       filter: blur(6px);
     }
     to {
       opacity: 1;
       transform: translateY(0) scale(1);
       filter: blur(0);
     }
   }
   
   .login-card-header {
     display: flex;
     align-items: flex-start;
     justify-content: space-between;
     gap: 12px;
     margin-bottom: 22px;
   }
   
   .login-small-title {
     font-family: var(--font-mono);
     font-size: 10px;
     letter-spacing: 0.22em;
     color: var(--text-faint);
   }
   
   .login-card-header h2 {
     font-family: var(--font-display);
     font-size: 21px;
     font-weight: 600;
     margin: 3px 0 4px;
     color: var(--text);
   }
   
   .login-card-header p {
     margin: 0;
     font-size: 13px;
     color: var(--text-muted);
   }
   
   .login-header-icon {
     flex-shrink: 0;
     width: 42px;
     height: 42px;
     border-radius: 12px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: color-mix(in srgb, var(--accent) 14%, transparent);
     color: var(--accent);
     font-size: 16px;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Alert                                                                  */
   /* ---------------------------------------------------------------------- */
   
   .login-alert {
     display: flex;
     gap: 12px;
     align-items: flex-start;
     background: var(--danger-bg);
     border: 1px solid var(--danger-border);
     border-radius: 12px;
     padding: 13px 14px;
     margin-bottom: 20px;
   }
   
   .login-alert-icon {
     color: var(--danger);
     font-size: 16px;
     margin-top: 1px;
   }
   
   .login-alert strong {
     display: block;
     font-size: 13px;
     color: var(--danger);
     margin-bottom: 2px;
   }
   
   .login-alert p {
     margin: 0;
     font-size: 12.5px;
     color: var(--text-muted);
     line-height: 1.4;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Form                                                                   */
   /* ---------------------------------------------------------------------- */
   
   .login-form {
     display: flex;
     flex-direction: column;
     gap: 16px;
   }
   
   .login-group label {
     display: block;
     font-size: 12px;
     font-weight: 500;
     color: var(--text-muted);
     margin-bottom: 7px;
     letter-spacing: 0.01em;
   }
   
   .login-input {
     position: relative;
     display: flex;
     align-items: center;
     background: var(--surface-raised);
     border: 1px solid var(--border);
     border-radius: 12px;
     padding: 0 14px;
     transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
   }
   
   .login-input i {
     font-size: 14px;
     color: var(--text-faint);
     width: 18px;
     text-align: center;
     transition: color 0.18s ease;
   }
   
   .login-input input {
     flex: 1;
     border: 0;
     outline: 0;
     background: transparent;
     color: var(--text);
     font-family: var(--font-body);
     font-size: 15px;
     padding: 13px 10px;
     min-width: 0;
   }
   
   .login-input input::placeholder {
     color: var(--text-faint);
   }
   
   .login-input.active,
   .login-input:focus-within {
     border-color: var(--accent);
   }
   
   .login-input.active i,
   .login-input:focus-within i {
     color: var(--accent);
   }
   
   .password-toggle {
     background: none;
     border: 0;
     color: var(--text-faint);
     cursor: pointer;
     padding: 6px;
     font-size: 14px;
     display: flex;
     align-items: center;
   }
   
   .password-toggle:hover {
     color: var(--accent);
   }
   
   .login-option {
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin: 2px 0 4px;
     flex-wrap: wrap;
     gap: 8px;
   }
   
   .remember {
     display: flex;
     align-items: center;
     gap: 8px;
     font-size: 12.5px;
     color: var(--text-muted);
     cursor: pointer;
     user-select: none;
   }
   
   .remember input[type="checkbox"] {
     appearance: none;
     width: 16px;
     height: 16px;
     border-radius: 5px;
     border: 1px solid var(--border-strong);
     background: var(--surface-raised);
     display: inline-grid;
     place-content: center;
     cursor: pointer;
     transition: background-color 0.15s ease, border-color 0.15s ease;
   }
   
   .remember input[type="checkbox"]::before {
     content: "";
     width: 8px;
     height: 8px;
     border-radius: 2px;
     transform: scale(0);
     transition: transform 0.12s ease;
     box-shadow: inset 1em 1em var(--accent-contrast);
     clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
     background: var(--accent-contrast);
   }
   
   .remember input[type="checkbox"]:checked {
     background: var(--accent);
     border-color: var(--accent);
   }
   
   .remember input[type="checkbox"]:checked::before {
     transform: scale(1);
   }
   
   .secure {
     display: flex;
     align-items: center;
     gap: 5px;
     font-family: var(--font-mono);
     font-size: 10.5px;
     letter-spacing: 0.05em;
     color: var(--text-faint);
   }
   
   .secure i {
     color: var(--accent);
     font-size: 10px;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Submit button — aperture iris loader                                  */
   /* ---------------------------------------------------------------------- */
   
   .login-button {
     position: relative;
     border: 0;
     border-radius: 12px;
     padding: 15px 18px;
     margin-top: 6px;
     background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ff3d00));
     color: var(--accent-contrast);
     font-family: var(--font-body);
     font-weight: 600;
     font-size: 14.5px;
     letter-spacing: 0.01em;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--accent) 65%, transparent);
     transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
   }
   
   .login-button:hover {
     filter: brightness(1.06);
     transform: translateY(-1px);
   }
   
   .login-button:active {
     transform: translateY(0);
   }
   
   .login-button .btn-loader {
     display: none;
   }
   
   .login-button.loading .btn-text {
     visibility: hidden;
   }
   
   .login-button.loading .btn-loader {
     display: flex;
     position: absolute;
     inset: 0;
     align-items: center;
     justify-content: center;
   }
   
   .login-button.loading .btn-loader i {
     animation: iris-spin 0.85s linear infinite;
   }
   
   @keyframes iris-spin {
     to { transform: rotate(360deg); }
   }
   
   .login-button:disabled {
     cursor: progress;
   }
   
   /* film-strip perforation divider above the footer */
   .film-strip {
     display: flex;
     justify-content: space-between;
     margin: 24px 2px 4px;
     opacity: 0.5;
   }
   
   .film-strip span {
     width: 5px;
     height: 5px;
     border-radius: 1.5px;
     background: var(--border-strong);
   }
   
   .login-footer {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 7px;
     margin-top: 6px;
     font-size: 11px;
     color: var(--text-faint);
   }
   
   .login-footer i {
     font-size: 10px;
   }
   
   /* ---------------------------------------------------------------------- */
   /* Tablet and up                                                          */
   /* ---------------------------------------------------------------------- */
   
   @media (min-width: 640px) {
     .login-container {
       max-width: 460px;
       gap: 34px;
     }
   
     .login-brand h1 {
       font-size: 30px;
     }
   
     .login-card {
       padding: 38px 36px 32px;
       border-radius: 24px;
     }
   
     .login-card-header h2 {
       font-size: 23px;
     }
   
     .login-input input {
       padding: 14px 10px;
     }
   
     .login-button {
       padding: 16px 18px;
     }
   }
   
   /* ---------------------------------------------------------------------- */
   /* Small phones                                                           */
   /* ---------------------------------------------------------------------- */
   
   @media (max-width: 360px) {
     .login-card {
       padding: 24px 18px 20px;
       border-radius: 16px;
     }
   
     .login-brand h1 {
       font-size: 24px;
     }
   
     .viewfinder-logo {
       width: 68px;
       height: 68px;
     }
   }
   
   /* Short viewports (landscape phones) — tame the entrance animation spacing */
   @media (max-height: 560px) {
     .login-page {
       align-items: flex-start;
       padding-top: 20px;
     }
   
     .login-brand {
       display: none;
     }
   }
   
   /* ---------------------------------------------------------------------- */
   /* Reduced motion                                                         */
   /* ---------------------------------------------------------------------- */
   
   @media (prefers-reduced-motion: reduce) {
     .light-leak,
     .login-card,
     .login-button.loading .btn-loader i {
       animation: none !important;
     }
   }
   
   /* ---------------------------------------------------------------------- */
   /* Focus visibility (accessibility)                                      */
   /* ---------------------------------------------------------------------- */
   
   a:focus-visible,
   button:focus-visible,
   input:focus-visible {
     outline: 2px solid var(--accent);
     outline-offset: 2px;
   }
   
   .login-input input:focus-visible,
   .login-input .password-toggle:focus-visible {
     outline: none;
   }
   