/* ===================================
   AUTH UI
   Extracted from auth layout and login view
   =================================== */

:root {
    --auth-bg-base: #050505;
    --auth-bg-gradient-start: #020202;
    --auth-bg-gradient-mid: #0a0a0a;
    --auth-bg-gradient-end: #171717;
    --auth-grid-pattern: rgba(255, 255, 255, 0.05);
    --auth-card-bg: rgba(20, 20, 20, 0.6);
    --auth-card-border: rgba(255, 255, 255, 0.06);
    --auth-card-border-inset: rgba(255, 255, 255, 0.04);
    --auth-card-border-outer: rgba(255, 255, 255, 0.03);
    --auth-checkbox-border: #2a2a2a;
    --auth-checkbox-bg: rgba(20, 20, 20, 0.5);
    --auth-checkbox-checked-bg: #ffffff;
    --auth-checkbox-checked-border: #ffffff;
    --auth-text-muted: #a1a1aa;
    --auth-text-light: #f4f4f5;
    --auth-text-white: #ffffff;
    --auth-input-bg: rgba(255, 255, 255, 0.04);
    --auth-input-border: rgba(255, 255, 255, 0.08);
    --auth-input-focus-border: rgba(255, 255, 255, 0.25);
    --auth-input-focus-bg: rgba(255, 255, 255, 0.07);
    --auth-btn-primary-hover: #e4e4e7;
    --auth-success-bg: rgba(34, 197, 94, 0.2);
    --auth-success-border: rgba(34, 197, 94, 0.3);
    --auth-success-text: #86efac;
    --auth-error-bg: rgba(239, 68, 68, 0.2);
    --auth-error-border: rgba(239, 68, 68, 0.3);
    --auth-error-text: #fca5a5;
    --auth-demo-bg: rgba(251, 191, 36, 0.1);
    --auth-demo-border: rgba(251, 191, 36, 0.3);
    --auth-demo-text: #fde68a;
    --auth-demo-strong: #fcd34d;
}

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.auth-container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background:
        radial-gradient(110% 70% at 50% 115%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 55%),
        linear-gradient(180deg, var(--auth-bg-base) 0%, #080808 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-auth-custom {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    width: 100%;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
        radial-gradient(140% 85% at 50% 115%, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 22%, transparent 52%),
        linear-gradient(180deg, var(--auth-bg-gradient-start) 0%, var(--auth-bg-gradient-mid) 48%, var(--auth-bg-gradient-end) 100%);
}

.bg-pearl-mist {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 242, 239, 0.06), transparent 70%), var(--dark-bg);
}

.bg-pattern-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
    background-image:
        linear-gradient(45deg, transparent 49%, var(--auth-grid-pattern) 49%, var(--auth-grid-pattern) 51%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, var(--auth-grid-pattern) 49%, var(--auth-grid-pattern) 51%, transparent 51%);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0, 0, 0, 1) 28%, transparent 72%);
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0, 0, 0, 1) 28%, transparent 72%);
}

.glass-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--auth-card-border);
    border-radius: 1.25rem;
    box-shadow:
        0 0 0 0.5px var(--auth-card-border-inset) inset,
        0 0 0 1px var(--auth-card-border-outer),
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s;
    pointer-events: none;
    z-index: 10;
}

.auth-icon {
    width: 16px;
    height: 16px;
}

.auth-icon-check {
    width: 12px;
    height: 12px;
    color: #000;
    opacity: 0;
    display: block;
    transition: opacity 0.2s;
    margin: auto;
}

.auth-input:focus ~ .input-icon,
.input-field:focus + .input-icon {
    color: rgba(255, 255, 255, 0.7);
}

.custom-checkbox {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--auth-checkbox-border);
    border-radius: 0.25rem;
    background: var(--auth-checkbox-bg);
    transition: all 0.2s;
    cursor: pointer;
}

.custom-checkbox.checked {
    background: var(--auth-checkbox-checked-bg);
    border-color: var(--auth-checkbox-checked-border);
}

.flash-message {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    max-width: 28rem;
    width: 90%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.flash-success {
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
    border: 1px solid var(--auth-success-border);
    backdrop-filter: blur(12px);
}

.flash-error {
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
    border: 1px solid var(--auth-error-border);
    backdrop-filter: blur(12px);
}

.auth-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    margin-left: 0.25rem;
    margin-bottom: 0.375rem;
}

.auth-input {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    color: var(--auth-text-light);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    border-radius: 0.75rem;
    padding: 0.625rem 1rem 0.625rem 3rem !important;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.auth-input.has-suffix {
    padding-right: 3rem;
}

.auth-input:focus {
    border-color: var(--auth-input-focus-border);
    background: var(--auth-input-focus-bg);
}

.auth-btn-primary {
    width: 100%;
    background: var(--ui-white);
    color: var(--ui-black);
    font-weight: 700;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.auth-btn-primary:hover {
    background: #e4e4e7;
}

.auth-btn-primary:active {
    transform: scale(0.98);
}

.auth-btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.auth-btn-ghost {
    background: none;
    border: none;
    color: #a1a1aa;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.auth-btn-ghost:hover {
    color: #ffffff;
}

.auth-btn-ghost.is-hidden {
    display: none;
}

.auth-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f4f4f5;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.auth-btn-google:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0;
}

.auth-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0;
}

.auth-divider span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.auth-demo-notice {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    font-size: 0.8125rem;
    color: #fde68a;
    line-height: 1.5;
}

.auth-demo-notice strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #fcd34d;
}

.auth-demo-notice code {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.auth-strength-bar {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    transition: background 0.3s;
}

.auth-pwd-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.auth-pwd-toggle:hover {
    color: rgba(255, 255, 255, 0.75);
}

.auth-panel-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-panel-card {
    padding: 2rem;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.auth-brand {
    margin-bottom: 1.5rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.025em;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.38);
    text-align: center;
}

.auth-form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form-stack.is-hidden {
    display: none;
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-input {
    display: none;
}

.auth-remember-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
}

.auth-submit-spacer {
    margin-top: 0.5rem;
}

.auth-strength-indicator {
    display: none;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.auth-strength-label {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.auth-strength-bars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.auth-strength-text {
    font-size: 0.688rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
}

.auth-message {
    display: none;
    padding: 0.625rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.auth-message.is-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.auth-message.is-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-action-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.auth-flex-grow {
    flex: 1;
}
