/* =========================
   AUTH PAGES
========================= */

:root{
    --auth-primary:#6366f1;
    --auth-primary-dark:#4338ca;
    --auth-bg:#f8fafc;
    --auth-card:#ffffff;
}

.auth-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:70vh;
    padding:24px 16px;
}

.auth-card{
    width:100%;
    max-width:400px;
    background:linear-gradient(145deg,var(--auth-card),var(--auth-bg));
    padding:30px;
    border-radius:24px;
    box-shadow:
        0 25px 60px rgba(0,0,0,.15),
        inset 0 2px 4px rgba(255,255,255,.5);
    display:flex;
    flex-direction:column;
    gap:16px;
    text-align:center;
    position:relative;
    overflow:hidden;
    backdrop-filter:blur(10px);
    animation:fadeSlide .3s ease;
}

.auth-card form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.auth-row{
    display:flex;
    gap:10px;
}

.auth-row input{ flex:1; }

.auth-card input{
    padding:14px;
    border-radius:14px;
    border:1px solid #e5e7eb;
    font-size:15px;
    background:#f9fafb;
    transition:all .2s ease;
}

.auth-card input:focus{
    outline:none;
    border-color:var(--auth-primary);
    background:white;
    box-shadow:0 0 0 3px rgba(99,102,241,.15);
    transform:translateY(-1px);
}

/* password inputs sit inside .password-wrap — no centering needed */
.auth-card input[name="password"],
.auth-card input[name="confirm_password"]{
    max-width:100%;
    margin:0;
}

.auth-card button{
    width:200px;
    margin:10px auto 0 auto;
    padding:14px;
    border:none;
    border-radius:16px;
    background:linear-gradient(135deg,var(--auth-primary),var(--auth-primary-dark));
    color:white;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    will-change:transform;
    box-shadow:0 12px 24px rgba(99,102,241,.35);
    transition:all .2s ease;
}

.auth-card button:hover{
    transform:translateY(-2px) scale(1.02);
}

.auth-card button:focus-visible,
.pin-button:focus-visible{
    outline:3px solid white;
    outline-offset:3px;
}

.auth-sub{ margin-bottom:10px; }

.auth-logo{
    width:70px;
    margin:auto;
    border-radius:18px;
    box-shadow:
        0 10px 25px rgba(0,0,0,.2),
        inset 0 2px 4px rgba(255,255,255,.4);
}

.auth-footer{
    margin-top:10px;
    font-size:14px;
}

.auth-footer a{
    color:#4f46e5;
    font-weight:600;
    text-decoration:none;
}

.auth-error{
    background:#fee2e2;
    color:#b91c1c;
    padding:10px;
    border-radius:10px;
}

.auth-hint{
    font-size:12px;
    color:#6b7280;
    margin-top:-8px;
    margin-bottom:6px;
}

/* =========================
   PIN
========================= */

.pin-input{
    text-align:center;
    letter-spacing:10px;
    font-size:22px;
    font-weight:600;
    padding:16px;
    border-radius:16px;
    background:#f9fafb;
    border:1px solid #e5e7eb;
    max-width:220px;
    margin:0 auto;
    transition:all .2s ease;
}

.pin-input:focus{
    outline:none;
    border-color:var(--auth-primary);
    background:white;
    box-shadow:0 0 0 4px rgba(99,102,241,.15);
}

.pin-title{ font-size:20px; font-weight:700; }
.pin-sub{ font-size:13px; color:#6b7280; margin-top:-6px; }
.pin-card{ max-width:320px; }

.pin-button{
    width:180px;
    margin:10px auto 0 auto;
    padding:14px;
    border:none;
    border-radius:14px;
    background:linear-gradient(135deg,var(--auth-primary),var(--auth-primary-dark));
    color:white;
    font-weight:600;
    cursor:pointer;
    will-change:transform;
    box-shadow:0 10px 20px rgba(99,102,241,.3);
    transition:all .2s ease;
}

.pin-button:hover{ transform:translateY(-2px); }
.pin-settings{ transition:all .3s ease; }
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
    isolation:isolate;
}

.password-wrap input {
    flex: 1;
    padding-right: 44px;
    max-width: 100%;
    margin: 0;
}

.show-pw-btn:hover {
    opacity: 0.7;
}

.show-pw-btn:active {
    transform: none;
}



/* =========================
   AUTH LABELS + PASSWORD TOGGLE
========================= */

.auth-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    margin-top: 4px;
}



.show-pw-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    color: #6b7280;
    transition: opacity .2s ease;
    will-change:opacity;
    box-shadow: none;
}



.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #4f46e5;
    text-decoration: none;
    margin-top: -4px;
    margin-bottom: 4px;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Fix: show-pw-btn must not inherit .auth-card button styles */
.auth-card .show-pw-btn {
    width: auto;
    margin: 0;
    padding: 4px 8px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity .2s ease;
}

.auth-card .show-pw-btn:hover {
    opacity: 0.7;
    transform: translateY(-50%);
    box-shadow: none;
}

.auth-card .show-pw-btn:active {
    transform: translateY(-50%);
}

@media (max-width:480px){
    .auth-card{
        padding:24px 18px;
        border-radius:20px;
    }

    .auth-card button,
    .pin-button{
        width:100%;
    }

    .auth-row{
        flex-direction:column;
    }
}