/* ============================================================
   HostModules — Shared Auth Pages CSS
   Login, Register (Client + Admin)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
    --hm-primary:   #0168fa;
    --hm-primary-d: #0153cc;
    --hm-body:      #97a3b9;
    --hm-border:    #e5e9f2;
    --hm-bg:        #fafafb;
}

html, body { height: 100%; margin: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--hm-bg);
    color: #1a202c;
    display: flex;
    min-height: 100vh;
}

/* ── Left brand panel ───────────────────────────────────────── */
.auth-brand {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
}

/* Client theme (default) */
.auth-brand {
    background: linear-gradient(160deg, #182229 0%, #0f1b20 100%);
}
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 85% 15%, rgba(193,237,0,.12) 0%, transparent 55%),
        radial-gradient(circle at 10% 85%, rgba(38,242,153,.08) 0%, transparent 50%);
}
.auth-brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(193,237,0,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(193,237,0,.05) 1px, transparent 1px);
    background-size: 36px 36px;
}

/* Admin theme override */
.auth-brand.admin-theme {
    width: 380px;
    background: linear-gradient(160deg, #001737 0%, #0c2461 100%);
}
.auth-brand.admin-theme::before {
    background-image:
        radial-gradient(circle at 80% 20%, rgba(1,104,250,.25) 0%, transparent 55%),
        radial-gradient(circle at 10% 80%, rgba(1,104,250,.15) 0%, transparent 50%);
}
.auth-brand.admin-theme .auth-brand-grid {
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
}
.auth-brand.admin-theme .auth-brand-badge {
    background: rgba(1,104,250,.25);
    border-color: rgba(1,104,250,.45);
    color: #6eb5ff;
}
.auth-brand.admin-theme .auth-brand-mid p {
    color: rgba(255,255,255,.55);
}

/* Shared brand elements */
.auth-brand-top { position: relative; z-index: 1; }

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.auth-brand-logo img { height: 32px; }
.auth-brand-logo span {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
}

.auth-brand-mid {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}
.auth-brand-mid h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 14px;
}
.auth-brand-mid p {
    font-size: .92rem;
    color: rgba(255,255,255,.5);
    line-height: 1.65;
    margin: 0;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(193,237,0,.12);
    border: 1px solid rgba(193,237,0,.3);
    color: #c1ed00;
    font-size: .76rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: .4px;
    text-transform: uppercase;
    margin-bottom: 20px;
    width: fit-content;
}

.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}
.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: rgba(255,255,255,.6);
    padding: 5px 0;
}
.auth-feature-list li .feat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c1ed00, #26f299);
    flex-shrink: 0;
}

.auth-brand-bottom {
    position: relative;
    z-index: 1;
}
.auth-brand-bottom p {
    font-size: .78rem;
    color: rgba(255,255,255,.25);
    margin: 0;
}

.new-account-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: rgba(255,255,255,.45);
    text-decoration: none;
    margin-top: 12px;
    transition: color .15s;
}
.new-account-link:hover { color: #c1ed00; }

/* ── Right form panel ───────────────────────────────────────── */
.auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

/* Register page has more fields — slightly wider */
.auth-card.auth-card--wide {
    max-width: 480px;
}

.auth-card-header {
    margin-bottom: 32px;
}
.auth-card-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 6px;
    letter-spacing: -.3px;
}
.auth-card-header p {
    font-size: .88rem;
    color: var(--hm-body);
    margin: 0;
}

/* Page-context badges (inside the form panel) */
.auth-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    width: fit-content;
    border: 1px solid;
}
.auth-page-badge--client {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.auth-page-badge--register {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.auth-page-badge--admin {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* ── Form controls ──────────────────────────────────────────── */
.form-label {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.input-group-text {
    background: #fff;
    border-right: 0;
    color: #9ca3af;
    padding-right: 8px;
}

.input-icon-field {
    border-left: 0;
    padding-left: 2px;
    font-size: .9rem;
}
.input-icon-field:focus {
    box-shadow: none;
    border-color: var(--hm-primary);
}
.input-group:focus-within .input-group-text {
    border-color: var(--hm-primary);
    color: var(--hm-primary);
}
.input-group:focus-within .input-icon-field {
    border-color: var(--hm-primary);
}

/* Plain inputs (no icon prefix) */
.auth-input {
    font-size: .9rem;
    border-color: var(--hm-border);
    border-radius: 6px;
}
.auth-input:focus {
    box-shadow: none;
    border-color: var(--hm-primary);
}

.password-toggle {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 0;
    color: #9ca3af;
    cursor: pointer;
    transition: color .15s;
    border-radius: 0 6px 6px 0;
    padding: 0 10px;
}
.password-toggle:hover { color: var(--hm-primary); background: #fff; }
.password-toggle:focus { box-shadow: none; border-color: var(--hm-primary); background: #fff; }
.input-group:focus-within .password-toggle { border-color: var(--hm-primary); }

/* Buttons */
.btn-auth-primary {
    background: var(--hm-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    padding: 11px 28px;
    border-radius: 6px;
    width: 100%;
    transition: background .18s;
    letter-spacing: .1px;
    cursor: pointer;
}
.btn-auth-primary:hover { background: var(--hm-primary-d); color: #fff; }
.btn-auth-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-auth-secondary {
    display: block;
    width: 100%;
    padding: 10px 28px;
    border: 1.5px solid var(--hm-border);
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.btn-auth-secondary:hover {
    border-color: var(--hm-primary);
    background: #f0f7ff;
    color: var(--hm-primary);
}

/* Backward-compat badge aliases */
.auth-client-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: .74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    width: fit-content;
}
.auth-admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: .74rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 14px;
    width: fit-content;
}

/* Aliases kept for backward compat */
.btn-signin {
    background: var(--hm-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    padding: 11px 28px;
    border-radius: 6px;
    width: 100%;
    transition: background .18s;
    letter-spacing: .1px;
    cursor: pointer;
}
.btn-signin:hover { background: var(--hm-primary-d); color: #fff; }
.btn-signin:disabled { opacity: .6; cursor: not-allowed; }

.btn-register {
    display: block;
    width: 100%;
    padding: 10px 28px;
    border: 1.5px solid var(--hm-border);
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: .9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.btn-register:hover {
    border-color: var(--hm-primary);
    background: #f0f7ff;
    color: var(--hm-primary);
}

/* Alerts */
.alert-auth {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: .85rem;
    padding: 10px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert-auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #15803d;
    font-size: .85rem;
    padding: 10px 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: .78rem;
    margin: 22px 0;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hm-border);
}

/* Misc */
.form-check-input:checked {
    background-color: var(--hm-primary);
    border-color: var(--hm-primary);
}

/* Password strength bar */
.pw-strength {
    height: 4px;
    border-radius: 4px;
    background: var(--hm-border);
    margin-top: 8px;
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width .3s, background .3s;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-brand { display: none !important; }
    .auth-form-wrap { padding: 32px 20px; }
    .auth-card.auth-card--wide { max-width: 100%; }
}
