/* ============================================================
   chatbara-auth.css  —  Shared auth page styles
   Place in: /chatbara/assets/css/auth.css
   ============================================================ */

   @import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

   /* ---- Reset ---- */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
   
   html, body {
     height: 100%;
     font-family: 'DM Sans', sans-serif;
     -webkit-font-smoothing: antialiased;
   }
   
   /* ---- Page layout ---- */
   .auth-page {
     min-height: 100vh;
     min-height: 100dvh;
     display: flex;
     align-items: stretch;
   }
   
   /* ---- Left panel — decorative ---- */
   .auth-panel {
     flex: 0 0 420px;
     background: #0f172a;
     position: relative;
     overflow: hidden;
     display: flex;
     flex-direction: column;
     justify-content: space-between;
     padding: 48px 44px;
   }
   
   /* Mesh gradient blobs */
   .auth-panel::before {
     content: '';
     position: absolute;
     width: 380px;
     height: 380px;
     background: radial-gradient(circle, rgba(99,102,241,.55) 0%, transparent 70%);
     top: -80px;
     left: -80px;
     border-radius: 50%;
     pointer-events: none;
   }
   .auth-panel::after {
     content: '';
     position: absolute;
     width: 300px;
     height: 300px;
     background: radial-gradient(circle, rgba(16,185,129,.35) 0%, transparent 70%);
     bottom: 60px;
     right: -60px;
     border-radius: 50%;
     pointer-events: none;
   }
   
   .panel-blob-mid {
     position: absolute;
     width: 220px;
     height: 220px;
     background: radial-gradient(circle, rgba(245,158,11,.2) 0%, transparent 70%);
     top: 45%;
     left: 30%;
     border-radius: 50%;
     pointer-events: none;
   }
   
   /* Dot grid overlay */
   .auth-panel-grid {
     position: absolute;
     inset: 0;
     background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
     background-size: 28px 28px;
     pointer-events: none;
   }
   
   .panel-content {
     position: relative;
     z-index: 2;
   }
   
   .panel-logo {
     display: flex;
     align-items: center;
     gap: 12px;
     margin-bottom: 64px;
   }
   
   .panel-logo-icon {
     width: 44px;
     height: 44px;
     background: linear-gradient(135deg, #6366f1, #8b5cf6);
     border-radius: 12px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 20px;
     color: #fff;
     box-shadow: 0 8px 20px rgba(99,102,241,.4);
     overflow: hidden;
     flex-shrink: 0;
   }
   .panel-logo-icon img {
     width: 28px;
     height: 28px;
     object-fit: contain;
     filter: none;
   }
   
   .panel-logo-text {
     font-family: 'Sora', sans-serif;
     font-size: 22px;
     font-weight: 700;
     color: #fff;
     letter-spacing: -.3px;
   }
   
   .panel-tagline {
     font-family: 'Sora', sans-serif;
     font-size: 32px;
     font-weight: 600;
     color: #fff;
     line-height: 1.25;
     letter-spacing: -.5px;
     margin-bottom: 16px;
   }
   
   .panel-tagline span {
     color: #a5b4fc;
   }
   
   .panel-desc {
     font-size: 14px;
     color: rgba(255,255,255,.55);
     line-height: 1.7;
     max-width: 280px;
   }
   
   .panel-features {
     margin-top: 40px;
     display: flex;
     flex-direction: column;
     gap: 12px;
   }
   
   .panel-feature {
     display: flex;
     align-items: center;
     gap: 10px;
     font-size: 13px;
     color: rgba(255,255,255,.7);
   }
   
   .panel-feature-dot {
     width: 6px;
     height: 6px;
     background: #6366f1;
     border-radius: 50%;
     flex-shrink: 0;
   }
   
   .panel-footer {
     position: relative;
     z-index: 2;
     font-size: 12px;
     color: rgba(255,255,255,.3);
   }
   
   /* ---- Right panel — bg image + glass card ---- */
   .auth-form-wrap {
     flex: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 32px 24px;
     position: relative;
     overflow: hidden;
   
     /* Background wallpaper — user places their image at /chatbara/uploads/bg.jpg */
     background-image: url('/chatbara/uploads/bg.jpg');
     background-size: cover;
     background-position: right;
     background-color: #c7d2e8; /* fallback if image missing */
   }
   
   /* Subtle darkening overlay so any bg image stays readable */
   .auth-form-wrap::before {
     content: '';
     position: absolute;
     inset: 0;
     background: rgba(15, 23, 42, 0.18);
     backdrop-filter: blur(0px);
     pointer-events: none;
     z-index: 0;
   }
   
   /* Glass card */
   .auth-form-box {
     width: 100%;
     max-width: 420px;
     position: relative;
     z-index: 1;
     animation: formIn .4s cubic-bezier(.22,1,.36,1) both;
   
     background: rgba(255, 255, 255, 0.267);
     backdrop-filter: blur(20px) saturate(1.6);
     -webkit-backdrop-filter: blur(20px) saturate(1.6);
     border-radius: 24px;
     border: 1px solid rgba(255, 255, 255, 0.55);
     box-shadow:
       0 8px 32px rgba(15, 23, 42, 0.18),
       0 1px 0 rgba(255,255,255,0.8) inset;
     padding: 40px 36px;
   }
   
   /* ---- Glass mode: flip all form text to light for readability ---- */
   .auth-form-box .auth-heading h1 {
     color: #fff;
     text-shadow: 0 1px 6px rgba(0,0,0,.35);
   }
   .auth-form-box .auth-heading p { color: rgba(255,255,255,.75); }
   .auth-form-box .form-field label { color: rgba(255,255,255,.9); }
   
   .auth-form-box .input-wrap input {
     background: rgba(255,255,255,.15);
     border-color: rgba(255,255,255,.3);
     color: #fff;
   }
   .auth-form-box .input-wrap input::placeholder { color: rgba(255,255,255,.4); }
   .auth-form-box .input-wrap input:focus {
     background: rgba(255,255,255,.22);
     border-color: rgba(255,255,255,.7);
     box-shadow: 0 0 0 3px rgba(255,255,255,.15);
   }
   .auth-form-box .input-wrap > i.input-icon { color: rgba(255,255,255,.5); }
   .auth-form-box .input-wrap input:focus ~ i.input-icon { color: rgba(255,255,255,.9); }
   .auth-form-box .pw-toggle { color: rgba(255,255,255,.5); }
   .auth-form-box .pw-toggle:hover { color: #fff; }
   
   .auth-form-box .auth-alert.error {
     background: rgba(220,38,38,.25);
     border-color: rgba(252,165,165,.4);
     color: #fecaca;
   }
   .auth-form-box .auth-alert.success {
     background: rgba(22,163,74,.25);
     border-color: rgba(134,239,172,.4);
     color: #bbf7d0;
   }
   .auth-form-box .auth-footer { color: rgba(255,255,255,.65); }
   .auth-form-box .auth-footer a { color: rgba(255,255,255,.95); text-decoration: underline; }
   .auth-form-box .auth-links-row { color: rgba(255,255,255,.65); }
   .auth-form-box .auth-links-row a { color: #fff; }
   .auth-form-box .pw-strength-label { color: rgba(255,255,255,.6); }
   
   /* OTP digits */
   .auth-form-box .otp-digit {
     background: rgba(255,255,255,.15);
     border-color: rgba(255,255,255,.3);
     color: #fff;
   }
   .auth-form-box .otp-digit:focus {
     border-color: rgba(255,255,255,.8);
     box-shadow: 0 0 0 3px rgba(255,255,255,.15);
   }
   .auth-form-box .otp-digit.filled {
     background: rgba(255,255,255,.25);
     border-color: rgba(255,255,255,.7);
     color: #fff;
   }
   .auth-form-box .otp-resend { color: rgba(255,255,255,.55); }
   .auth-form-box .otp-resend a { color: rgba(255,255,255,.9); }
   
   /* Back arrow link */
   .auth-form-box > a { color: rgba(255,255,255,.7) !important; }
   .auth-form-box > a:hover { color: #fff !important; }
   
   @keyframes formIn {
     from { opacity: 0; transform: translateY(20px); }
     to   { opacity: 1; transform: translateY(0); }
   }
   
   /* Mobile logo (hidden on desktop) */
   .mobile-logo {
     display: none;
     align-items: center;
     gap: 10px;
     margin-bottom: 32px;
   }
   .mobile-logo-icon {
     width: 38px;
     height: 38px;
     background: linear-gradient(135deg, #6366f1, #8b5cf6);
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     overflow: hidden;
   }
   .mobile-logo-icon img {
     width: 100%;
     height: 100%;
     object-fit: contain;
     padding: 5px;
   }
   .mobile-logo-text {
     font-family: 'Sora', sans-serif;
     font-size: 20px;
     font-weight: 700;
     color: #0f172a;
   }
   
   /* ---- Form heading ---- */
   .auth-heading {
     margin-bottom: 28px;
   }
   
   .auth-heading h1 {
     font-family: 'Sora', sans-serif;
     font-size: 26px;
     font-weight: 700;
     color: #0f172a;
     letter-spacing: -.4px;
     margin-bottom: 6px;
   }
   
   .auth-heading p {
     font-size: 14px;
     color: #64748b;
     line-height: 1.6;
   }
   
   /* ---- Form fields ---- */
   .form-field {
     margin-bottom: 16px;
   }
   
   .form-field label {
     display: block;
     font-size: 12.5px;
     font-weight: 600;
     color: #374151;
     text-transform: uppercase;
     letter-spacing: .5px;
     margin-bottom: 7px;
   }
   
   .input-wrap {
     position: relative;
     display: block;
   }
   
   /* Left icon */
   .input-wrap > i.input-icon {
     position: absolute;
     left: 14px;
     top: 50%;
     transform: translateY(-50%);
     color: #94a3b8;
     font-size: 14px;
     pointer-events: none;
     transition: color .2s;
     z-index: 1;
   }
   
   .input-wrap input {
     width: 100%;
     padding: 12px 14px 12px 40px;
     border: 1.5px solid #e2e8f0;
     border-radius: 10px;
     font-size: 14px;
     font-family: 'DM Sans', sans-serif;
     color: #0f172a;
     background: #fff;
     outline: none;
     transition: border-color .2s, box-shadow .2s;
     box-sizing: border-box;
   }
   
   .input-wrap input::placeholder { color: #cbd5e1; }
   
   .input-wrap input:focus {
     border-color: #6366f1;
     box-shadow: 0 0 0 3px rgba(99,102,241,.12);
   }
   
   .input-wrap input:focus ~ i.input-icon { color: #6366f1; }
   
   /* Password toggle button */
   .input-wrap .pw-toggle {
     position: absolute;
     right: 12px;
     top: 50%;
     transform: translateY(-50%);
     background: none;
     border: none;
     cursor: pointer;
     color: #94a3b8;
     font-size: 14px;
     padding: 4px;
     z-index: 2;
     line-height: 1;
     transition: color .2s;
   }
   .input-wrap .pw-toggle:hover { color: #6366f1; }
   .input-wrap input.has-toggle  { padding-right: 42px; }
   
   /* ---- Password strength ---- */
   .pw-strength {
     margin-top: 6px;
     display: flex;
     gap: 4px;
   }
   .pw-strength-bar {
     flex: 1;
     height: 3px;
     border-radius: 99px;
     background: #e2e8f0;
     transition: background .3s;
   }
   .pw-strength-bar.weak   { background: #f87171; }
   .pw-strength-bar.ok     { background: #fbbf24; }
   .pw-strength-bar.strong { background: #34d399; }
   
   .pw-strength-label {
     font-size: 11px;
     color: #94a3b8;
     margin-top: 4px;
   }
   
   /* ---- Alert ---- */
   .auth-alert {
     display: flex;
     align-items: flex-start;
     gap: 10px;
     padding: 12px 14px;
     border-radius: 10px;
     font-size: 13.5px;
     margin-bottom: 18px;
     animation: formIn .3s ease both;
   }
   .auth-alert.error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
   .auth-alert.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
   .auth-alert.info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
   .auth-alert i       { margin-top: 1px; flex-shrink: 0; }
   
   /* ---- Submit button ---- */
   .btn-auth {
     width: 100%;
     padding: 13px;
     background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
     color: #fff;
     border: none;
     border-radius: 10px;
     font-family: 'DM Sans', sans-serif;
     font-size: 15px;
     font-weight: 600;
     cursor: pointer;
     transition: transform .15s, box-shadow .15s, opacity .15s;
     box-shadow: 0 4px 14px rgba(99,102,241,.35);
     margin-top: 6px;
     letter-spacing: .1px;
   }
   .btn-auth:hover {
     transform: translateY(-1px);
     box-shadow: 0 6px 20px rgba(99,102,241,.45);
   }
   .btn-auth:active { transform: scale(.98); }
   .btn-auth:disabled { opacity: .6; cursor: not-allowed; transform: none; }
   
   /* ---- Divider ---- */
   .auth-divider {
     display: flex;
     align-items: center;
     gap: 12px;
     margin: 20px 0;
     color: #cbd5e1;
     font-size: 12px;
   }
   .auth-divider::before,
   .auth-divider::after {
     content: '';
     flex: 1;
     height: 1px;
     background: #e2e8f0;
   }
   
   /* ---- Footer links ---- */
   .auth-footer {
     margin-top: 22px;
     text-align: center;
     font-size: 13.5px;
     color: #64748b;
   }
   .auth-footer a {
     color: #6366f1;
     text-decoration: none;
     font-weight: 500;
     transition: color .15s;
   }
   .auth-footer a:hover { color: #4f46e5; text-decoration: underline; }
   
   .auth-links-row {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-top: 16px;
     font-size: 13.5px;
   }
   .auth-links-row a {
     color: #6366f1;
     text-decoration: none;
     font-weight: 500;
   }
   .auth-links-row a:hover { text-decoration: underline; }
   
   /* ---- OTP input ---- */
   .otp-group {
     display: flex;
     gap: 10px;
     justify-content: center;
     margin: 24px 0 8px;
   }
   .otp-digit {
     width: 52px;
     height: 58px;
     border: 1.5px solid #e2e8f0;
     border-radius: 12px;
     font-size: 22px;
     font-family: 'Sora', sans-serif;
     font-weight: 600;
     text-align: center;
     color: #0f172a;
     background: #fff;
     outline: none;
     transition: border-color .2s, box-shadow .2s;
     caret-color: #6366f1;
   }
   .otp-digit:focus {
     border-color: #6366f1;
     box-shadow: 0 0 0 3px rgba(99,102,241,.12);
   }
   .otp-digit.filled {
     border-color: #6366f1;
     background: #eef2ff;
     color: #4f46e5;
   }
   
   /* Hidden real OTP input */
   #otpHidden { display: none; }
   
   /* Resend */
   .otp-resend {
     text-align: center;
     font-size: 13px;
     color: #94a3b8;
     margin-top: 12px;
   }
   .otp-resend a {
     color: #6366f1;
     font-weight: 500;
     text-decoration: none;
   }
   
   /* ---- Responsive ---- */
   @media (max-width: 860px) {
     .auth-panel { display: none; }
     .mobile-logo { display: flex; }
     /* On mobile the bg image still shows — glass card looks great */
     .auth-form-wrap {
       padding: 24px 16px;
       align-items: center;
     }
     .auth-form-box {
       padding: 28px 22px;
     }
     .auth-form-wrap {
        background-position: left; /* adjust this */
      }
   }
   
   @media (max-width: 480px) {
     .auth-form-box { max-width: 100%; }
     .otp-digit { width: 42px; height: 50px; font-size: 18px; }
     .otp-group { gap: 7px; }
   }
   
   /* ---- Kill browser autofill yellow & match glass vibe ---- */
   .auth-form-box .input-wrap input:-webkit-autofill,
   .auth-form-box .input-wrap input:-webkit-autofill:hover,
   .auth-form-box .input-wrap input:-webkit-autofill:focus,
   .auth-form-box .input-wrap input:-webkit-autofill:active {
     -webkit-box-shadow: 0 0 0 999px rgba(80, 70, 150, 0.35) inset !important;
     box-shadow: 0 0 0 999px rgba(80, 70, 150, 0.35) inset !important;
     -webkit-text-fill-color: #fff !important;
     caret-color: #fff;
     border-color: rgba(255,255,255,.45) !important;
     transition: background-color 9999s ease-in-out 0s;
   }