/* AI Assistant Login Form - Complete & Self-Contained */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

/* Neural Background */
.neural-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.neural-node {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #3b82f6;
    border-radius: 50%;
    opacity: 0.6;
    animation: neuralPulse 4s ease-in-out infinite;
}

.neural-node:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.neural-node:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.neural-node:nth-child(3) {
    top: 80%;
    left: 20%;
    animation-delay: 2s;
}

.neural-node:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 3s;
}

.neural-node:nth-child(5) {
    top: 10%;
    left: 60%;
    animation-delay: 4s;
}

@keyframes neuralPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.5); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
}

.ai-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: aiGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aiGlow {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.ai-logo {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-core {
    position: relative;
    z-index: 3;
    color: #3b82f6;
    animation: coreRotate 8s linear infinite;
}

@keyframes coreRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ring {
    position: absolute;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: ringPulse 3s ease-in-out infinite;
}

.ring-1 {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-delay: 0s;
}

.ring-2 {
    width: 70px;
    height: 70px;
    top: 5px;
    left: 5px;
    animation-delay: 1s;
}

.ring-3 {
    width: 80px;
    height: 80px;
    top: 0;
    left: 0;
    animation-delay: 2s;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.login-header h1 {
    color: #f8fafc;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-header p {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 400;
}

/* Smart Fields */
.smart-field {
    position: relative;
    margin-bottom: 28px;
}

.field-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.smart-field input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px 50px 16px 16px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    position: relative;
    z-index: 2;
    font-family: inherit;
}

.smart-field input::placeholder {
    color: transparent;
}

.smart-field label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 3;
    background: rgba(15, 15, 20, 0.8);
    padding: 0 4px;
}

.smart-field input:focus + label,
.smart-field input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    font-weight: 500;
    color: #3b82f6;
    transform: translateY(-50%);
}

.smart-field input:focus ~ .field-background {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.ai-indicator {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    z-index: 4;
}

.ai-pulse {
    width: 100%;
    height: 100%;
    background: #3b82f6;
    border-radius: 50%;
    opacity: 0;
    animation: aiIndicator 2s ease-in-out infinite;
}

.smart-field input:focus ~ .ai-indicator .ai-pulse {
    opacity: 1;
}

@keyframes aiIndicator {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.5); opacity: 1; }
}

.field-completion {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 0 0 12px 12px;
}

.smart-field input:valid ~ .field-completion {
    width: 100%;
}

/* Password Toggle */
.smart-field:has(.smart-toggle) input {
    padding-right: 90px;
}

.smart-toggle {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-toggle:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.toggle-hide {
    display: none;
}

.smart-toggle.toggle-active .toggle-show {
    display: none;
}

.smart-toggle.toggle-active .toggle-hide {
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.smart-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 500;
}

.smart-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-ai {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-core {
    width: 100%;
    height: 100%;
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    background: rgba(30, 41, 59, 0.5);
    transition: all 0.3s ease;
    position: absolute;
}

.checkbox-ai svg {
    color: transparent;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.smart-checkbox input[type="checkbox"]:checked + .checkbox-ai .checkbox-core {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.smart-checkbox input[type="checkbox"]:checked + .checkbox-ai svg {
    color: #ffffff;
}

.neural-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.neural-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.neural-link:hover::after {
    width: 100%;
}

.neural-link:hover {
    color: #60a5fa;
}

/* Neural Button */
.neural-button {
    width: 100%;
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    margin-bottom: 28px;
    overflow: hidden;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6, #cb8798);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.neural-button:hover .button-bg {
    background: linear-gradient(135deg, #2563eb, #de4c71);
    transform: scale(1.02);
}

.neural-button:active .button-bg {
    transform: scale(0.98);
}

.button-text {
    position: relative;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.button-loader {
    position: absolute;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.neural-spinner {
    display: flex;
    gap: 4px;
}

.spinner-segment {
    width: 4px;
    height: 16px;
    background: #ffffff;
    border-radius: 2px;
    animation: neuralSpinner 1.2s ease-in-out infinite;
}

.spinner-segment:nth-child(2) { animation-delay: 0.1s; }
.spinner-segment:nth-child(3) { animation-delay: 0.2s; }

@keyframes neuralSpinner {
    0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    40% { transform: scaleY(1); opacity: 1; }
}

.neural-button.loading .button-text {
    opacity: 0;
}

.neural-button.loading .button-loader {
    opacity: 1;
}

.button-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 14px;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.neural-button:hover .button-glow {
    opacity: 0.6;
}

/* Auth Separator */
.auth-separator {
    display: flex;
    align-items: center;
    margin: 28px 0;
    gap: 16px;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.separator-text {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Neural Social */
.neural-social {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.social-neural {
    flex: 1;
    background: transparent;
    color: #cbd5e1;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-height: 46px;
    position: relative;
    overflow: hidden;
}

.social-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.social-neural:hover .social-bg {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.4);
}

.social-neural span {
    position: relative;
    z-index: 2;
}

.social-neural svg {
    position: relative;
    z-index: 2;
}

.social-glow {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 11px;
    opacity: 0;
    filter: blur(4px);
    transition: opacity 0.2s ease;
    z-index: 0;
}

.social-neural:hover .social-glow {
    opacity: 1;
}

/* Signup Section */
.signup-section {
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.neural-signup {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.neural-signup::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.neural-signup:hover::after {
    width: 100%;
}

.neural-signup:hover {
    color: #60a5fa;
}

/* Error States */
.error-message {
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    position: relative;
    z-index: 5;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.smart-field.error .field-background {
    border-color: #873e3e;
    background: rgba(239, 68, 68, 0.1);
}

.smart-field.error label {
    color: #873e3e;
}

.smart-field.error .field-completion {
    background: #873e3e;
}

/* Success Neural */
.success-neural {
    display: none;
    text-align: center;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.success-neural.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-core {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.success-ring {
    position: absolute;
    border: 2px solid #10b981;
    border-radius: 50%;
    animation: successRing 1s ease-out forwards;
}

.success-ring:nth-child(1) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-delay: 0s;
}

.success-ring:nth-child(2) {
    width: 70px;
    height: 70px;
    top: 5px;
    left: 5px;
    animation-delay: 0.2s;
}

.success-ring:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 0;
    left: 0;
    animation-delay: 0.4s;
}

@keyframes successRing {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.7; transform: scale(1); }
}

.success-core svg {
    color: #10b981;
    position: relative;
    z-index: 2;
    animation: successCheck 0.6s ease-out 0.6s forwards;
    opacity: 0;
}

@keyframes successCheck {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

.success-neural h3 {
    color: #f8fafc;
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-neural p {
    color: #94a3b8;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .ai-logo {
        width: 60px;
        height: 60px;
    }
    
    .ring-1 { width: 45px; height: 45px; top: 7.5px; left: 7.5px; }
    .ring-2 { width: 52px; height: 52px; top: 4px; left: 4px; }
    .ring-3 { width: 60px; height: 60px; top: 0; left: 0; }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .neural-social {
        flex-direction: column;
    }
}

/* === overrides === */

/* 1) remove the dark box behind the email/password text */
.smart-field .field-background {
    background: transparent;          /* no fill behind text */
  }
  
  /* optional: if you don't want the small dark chip behind the floating label */
  .smart-field label {
    background: transparent;
  }
  
  /* make sure browser autofill doesn't introduce a boxy background */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    box-shadow: 0 0 0px 1000px transparent inset;
    transition: background-color 9999s ease-out 0s;
  }
  
  /* 2) move the eyeball (password toggle) further to the right */
  .smart-field[data-field="password"] .smart-toggle {
    right: 12px;                      /* was 50px */
  }
  
  /* give the input extra padding so text never sits under the eyeball */
  .smart-field:has(.smart-toggle) input {
    padding-right: 72px;              /* was 90px; adjust to taste */
  }
  
  /* if you use the little ai-indicator dot, either move it or hide it on password */
  .smart-field[data-field="password"] .ai-indicator {
    display: none;                    /* or: right: 48px; */
  }
  
  .smart-field .error-message { margin-left: 8px; }

  /* per-field version */
  .smart-field[data-field="email"] .error-message { margin-left: 8px; }
  .smart-field[data-field="password"] .error-message { margin-left: 8px; }
  
  /* === Chatbot fix pack: contrast + layout ===================== */
/* Base colors (dark mode) */
html, body {
    background: #0b0f1a;           /* deep navy */
    color: #e5e7eb;                /* light text */
    min-height: 100%;
  }
  
  /* Make the main container use the screen width sensibly */
  .container {
    width: min(1100px, 94vw);      /* not scrunched */
    margin: 24px auto;
    padding: 0 12px;
  }
  
  /* Top bar spans full width of the container */
  .top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  /* Cards & borders more visible on dark bg */
  .info-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.14);
    color: #e5e7eb;
  }
  
  /* Muted text still readable */
  .muted { color: #9aa4b2; }
  
  /* Inputs, textareas, selects: ensure white text */
  input, textarea, select {
    color: #e5e7eb;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
  }
  input::placeholder,
  textarea::placeholder { color: #a7b0bd; }
  
  /* Buttons: make label readable regardless of gradient */
  .neural-button .button-text { color: #ffffff !important; }
  
  /* Chat area contrast + wrapping */
  #chatLog {
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.22);
    color: #e5e7eb;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  #chatInput {
    color: #e5e7eb;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
  }
  
  /* Grid tweaks so cards don't collapse too narrow */
  .grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  @media (max-width: 900px) {
    .grid.two { grid-template-columns: 1fr; }
  }
  
  /* Make the chat card breathe on small screens */
  .info-card #chatLog { height: clamp(220px, 40vh, 420px); }
  
  /* Optional: ensure links are visible */
  a { color: #93c5fd; }
  a:hover { color: #bfdbfe; }
  

/* WebLLM progress bar */
.webllm-progress {
    margin-top: 8px;
  }
  .webllm-progress .label {
    font-size: 12px;
    color: #9aa4b2;
    margin-bottom: 6px;
  }
  .webllm-progress .track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
  }
  .webllm-progress .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(147,197,253,.9), rgba(125,211,252,.9));
    transition: width .18s ease;
    box-shadow: 0 0 12px rgba(147,197,253,.35);
  }
  
  /* keep the progress area visible even at 0% */
#initProgress { min-height: 32px; }

/* ensure the bar isn't collapsed by parent styles */
.webllm-progress { display: block; }

/* WebLLM progress (single bar) */
.webllm-progress .track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
    overflow: hidden;
  }
  .webllm-progress .fill {
    height: 100%;
    border-radius: 999px;
    background:
      linear-gradient(to bottom, rgba(255,255,255,0.75), rgba(255,255,255,0.35)),
      linear-gradient(to right, rgba(120,180,255,0.45), rgba(160,120,255,0.45));
    box-shadow: inset 0 0 12px rgba(255,255,255,.35);
    transition: width .25s ease;
  }
  
  /* --- Floating labels that don't overlap --- */
.smart-field {
  position: relative;
  margin-bottom: 14px;
}

.smart-field input {
  width: 100%;
  padding: 14px 44px 14px 12px;       /* right padding leaves room for eye button */
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  color: inherit;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

.smart-field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: rgba(255,255,255,.75);
  transition: all .18s ease;
  pointer-events: none;
  padding: 0 6px;
  border-radius: 6px;
  background: transparent;
}

/* Float label on focus or when the field has content */
.smart-field:focus-within label,
.smart-field.filled label {
  top: -8px;
  transform: none;
  font-size: 11px;
  color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.25);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* --- Password eye button --- */
.password-wrap { position: relative; }

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(255,255,255,0.14);
}

/* Eye icon */
.password-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center / contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center / contain no-repeat;
  background: currentColor;
  color: rgba(255,255,255,.9);
}

/* Eye-off when revealing password */
.password-toggle[aria-pressed="true"]::before {
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center / contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center / contain no-repeat;
  background: currentColor;
}

/* ==== FIX: floating labels + eye clickability ==== */

/* Keep labels floated whenever there's content OR focus OR autofill */
.smart-field { position: relative; }
.smart-field label{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  font-size:14px; color:rgba(255,255,255,.75);
  padding:0 6px; border-radius:6px; transition:all .18s ease;
  pointer-events:none;           /* <— label never steals clicks */
  z-index:0;                     /* sits under input/eye */
  background:transparent;
}
.smart-field:focus-within label,
.smart-field.filled label{
  top:-8px; transform:none; font-size:11px;
  color:rgba(255,255,255,.92);
  background:rgba(0,0,0,.25);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

/* Autofill variants keep label floated */
input:-webkit-autofill ~ label,
input:-internal-autofill-selected ~ label{
  top:-8px !important; transform:none !important; font-size:11px !important;
}

/* Inputs keep text clear of the eye icon */
.smart-field input{
  position:relative; z-index:1;
  padding-right:44px; /* room for eye */
}

/* Eye sits above input and is fully clickable */
.password-wrap{ position:relative; }
.password-toggle{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; border:0; border-radius:10px;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  display:grid; place-items:center; cursor:pointer;
  z-index:2; /* <— above input text & label */
}
.password-toggle:hover{ background: rgba(255,255,255,0.14); }

/* Eye icon (closed) */
.password-toggle::before{
  content:""; width:18px; height:18px; display:block;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center/contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center/contain no-repeat;
  background: currentColor; color: rgba(255,255,255,.92);
}
/* Eye icon (open) when pressed */
.password-toggle[aria-pressed="true"]::before{
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center/contain no-repeat;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center/contain no-repeat;
}


/* Floating labels that STAY up when input has text or focus */
/* Works even when <label> comes before <input> */
.smart-field { position: relative; margin-bottom: 16px; }

/* base input */
.smart-field input{
  width:100%;
  padding:14px 44px 14px 12px;              /* room for eye */
  border:0; border-radius:14px;
  background:rgba(255,255,255,.05);
  color:#fff; box-shadow:inset 0 0 0 1px rgba(255,255,255,.10);
  outline:none;
}

/* base label sits centered over input */
.smart-field label{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  font-size:14px; color:rgba(255,255,255,.75);
  padding:0 6px; border-radius:6px;
  transition:all .18s ease;
  pointer-events:none; z-index:0; background:transparent;
}

/* float label when focused OR when there's content (using :has) */
.smart-field:has(input:focus) label,
.smart-field:has(input:not(:placeholder-shown)) label,
.smart-field.filled label {                     /* JS fallback */
  top:-8px; transform:none; font-size:11px;
  color:rgba(255,255,255,.92);
  background:rgba(0,0,0,.25);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}

/* keep floated on autofill */
.smart-field:has(input:-webkit-autofill) label { 
  top:-8px; transform:none; font-size:11px;
}

/* password eye stays clickable and doesn’t cover text */
.password-wrap{ position:relative; }
.password-toggle{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  width:34px; height:34px; border:0; border-radius:10px;
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.10);
  display:grid; place-items:center; cursor:pointer; z-index:2;
}
.password-toggle:hover{ background:rgba(255,255,255,.14); }
.password-toggle::before{
  content:""; width:18px; height:18px; display:block;
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center/contain no-repeat;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7"/><circle cx="12" cy="12" r="3"/></svg>') center/contain no-repeat;
  background:currentColor; color:rgba(255,255,255,.92);
}
.password-toggle[aria-pressed="true"]::before{
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center/contain no-repeat;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94"/><path d="M10.58 10.58a3 3 0 0 0 4.24 4.24"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.8 21.8 0 0 1-3.52 5.11"/><line x1="1" y1="1" x2="23" y2="23"/></svg>') center/contain no-repeat;
}

/* --- Password toggle always clickable; no overlay blocks it --- */
.smart-field .field-background { pointer-events: none; } /* background can't eat clicks */
.smart-field label { pointer-events: none; }             /* label can't eat clicks */

.password-toggle,
.smart-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  z-index: 5;                 /* sit above inputs/background/labels */
}


/* --- Center auth pages (sign-in & sign-up) --- */
html, body { height: 100%; }

body.auth-centered {
  min-height: 100svh;            /* safe viewport units for mobile */
  display: grid;                  /* simplest centering */
  place-items: center;            /* centers horizontally + vertically */
  padding: 24px;                  /* breathing room on small screens */
}

/* Keep form a nice readable width */
body.auth-centered form {
  width: min(560px, 92vw);
  margin: 0 auto;
}
