/* ─── GLOBAL FIX (IMPORTANT) ─────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ─── PAGE ───────────────────────────────────────── */
.auth-page {
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(145deg, #0a1628 0%, #112236 45%, #0f1e33 100%);
    position:relative;
    padding:40px 20px;
    overflow:hidden;
}

/* Ambient blobs */
.auth-blob { 
    position:absolute; 
    border-radius:50%; 
    filter:blur(80px); 
    pointer-events:none; 
}
.ab-1 { width:360px; height:360px; background:radial-gradient(circle,rgba(52,152,219,0.2),transparent 70%); top:-15%; left:-10%; }
.ab-2 { width:280px; height:280px; background:radial-gradient(circle,rgba(26,188,156,0.12),transparent 70%); bottom:-12%; right:-8%; }
.ab-3 { width:180px; height:180px; background:radial-gradient(circle,rgba(52,152,219,0.08),transparent 70%); top:42%; right:18%; }

/* ─── Container ──────────────────────────────────── */
.auth-wrap {
    position:relative;
    z-index:1;
    width:100%;
    max-width:410px;
    display:flex;
    flex-direction:column;
    align-items:center;
}
.auth-wrap.wide { max-width:450px; }

/* ─── Logo ───────────────────────────────────────── */
.auth-logo { text-align:center; margin-bottom:24px; }
.auth-logo-icon {
    width:52px;
    height:52px;
    margin:0 auto 12px;
    background:linear-gradient(135deg,#1a3a5c,#243f5c);
    border-radius:13px;
    box-shadow:0 4px 16px rgba(52,152,219,0.22);
    display:flex;
    align-items:center;
    justify-content:center;
}
.auth-logo-icon svg { width:28px; height:28px; }
.auth-brand {
    font-family:'Playfair Display',serif;
    font-size:1.65rem;
    font-weight:700;
    color:var(--white);
}
.auth-brand-sub {
    color:var(--text-muted);
    font-size:0.8rem;
}

/* ─── Tabs ───────────────────────────────────────── */
.auth-tabs {
    display:flex;
    width:100%;
    background:var(--navy-800);
    border:1px solid rgba(52,152,219,0.12);
    border-radius:var(--radius-lg);
    padding:3px;
    margin-bottom:20px;
}
.auth-tab {
    flex:1;
    text-align:center;
    padding:9px 0;
    font-size:0.88rem;
    font-weight:600;
    color:var(--text-muted);
    border-radius:var(--radius-md);
    text-decoration:none;
}
.auth-tab.active {
    background:linear-gradient(135deg,var(--accent),#2e86c1);
    color:var(--white);
    box-shadow:0 2px 10px var(--accent-glow);
}

/* ─── Card ───────────────────────────────────────── */
.auth-card {
    width:100%;
    background:rgba(21,42,66,0.68);
    border:1px solid rgba(52,152,219,0.2);
    border-radius:var(--radius-xl);
    padding:32px 28px 28px;
    backdrop-filter:blur(8px);
    box-shadow:0 8px 36px rgba(0,0,0,0.28);
}

/* ─── Alerts ─────────────────────────────────────── */
.auth-alert {
    border-radius:var(--radius-md);
    padding:10px 14px;
    margin-bottom:18px;
    font-size:0.84rem;
}
.auth-alert-err {
    background:rgba(231,76,60,0.1);
    border:1px solid rgba(231,76,60,0.34);
    color:var(--red-light);
}

/* ─── Form Groups ────────────────────────────────── */
.ag { margin-bottom:16px; }
.ag label {
    display:block;
    color:var(--text-secondary);
    font-size:0.85rem;
    margin-bottom:5px;
}

/* Input wrapper */
.inp-wrap {
    position:relative;
    width:100%;
}

/* Input icons */
.inp-icon {
    position:absolute;
    left:13px;
    top:50%;
    transform:translateY(-50%);
    color:var(--text-muted);
}

/* INPUT FIXED HERE */
.inp-wrap input {
    width:100%;
    background:rgba(36,63,92,0.82);
    border:1px solid rgba(52,152,219,0.2);
    border-radius:var(--radius-md);
    padding:12px 38px;
    color:var(--text-primary);
    box-sizing:border-box; /* <-- critical */
}

.inp-wrap input:focus {
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(52,152,219,0.15);
}

/* Password toggle */
.pw-toggle {
    position:absolute;
    right:13px;
    top:50%;
    transform:translateY(-50%);
    background:none;
    border:none;
    cursor:pointer;
    color:var(--text-muted);
}

/* ─── Role Selection ─────────────────────────────── */
.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-option {
    cursor: pointer;
}

.role-option input[type="radio"] {
    display: none;
}

.role-card {
    background: rgba(36,63,92,0.5);
    border: 2px solid rgba(52,152,219,0.2);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 120px;
}

.role-card svg {
    width: 32px;
    height: 32px;
    color: rgba(52,152,219,0.6);
    transition: all 0.3s ease;
}

.role-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
}

.role-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.role-option input[type="radio"]:checked + .role-card {
    background: rgba(52,152,219,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.role-option input[type="radio"]:checked + .role-card svg {
    color: var(--accent);
    transform: scale(1.1);
}

.role-option:hover .role-card {
    border-color: rgba(52,152,219,0.4);
    background: rgba(36,63,92,0.7);
}

/* ─── Remember Row ───────────────────────────────── */
.remember-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:22px;
}

/* ─── Button ─────────────────────────────────────── */
.btn-auth {
    width:100%;
    background:linear-gradient(135deg,var(--accent),#2e86c1);
    color:var(--white);
    font-weight:600;
    padding:13px 0;
    border:none;
    border-radius:var(--radius-md);
    cursor:pointer;
    transition: all 0.3s ease;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

/* ─── Footer ─────────────────────────────────────── */
.auth-foot {
    margin-top:18px;
    text-align:center;
    color:var(--text-muted);
    font-size:0.84rem;
}

.auth-foot a {
    color: var(--accent);
    text-decoration: none;
}

.auth-foot a:hover {
    text-decoration: underline;
}

/* ─── Responsive ─────────────────────────────────── */
@media(max-width:460px){
    .auth-card { padding:24px 18px; }
    .auth-wrap,.auth-wrap.wide { max-width:100%; }
    .role-selection {
        grid-template-columns: 1fr;
    }
}