/* ==========================================================================
   Auth layout - Login / Register
   ========================================================================== */

.auth-shell {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.auth-layout {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 26px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 60px rgba(24, 45, 90, .10);
    border: 1px solid #e9edf5;
    animation: authRise .5s cubic-bezier(.2, .7, .3, 1);
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Brand column ---------- */
.auth-brand {
    position: relative;
    padding: 44px 38px;
    color: #fff;
    background: linear-gradient(150deg, #0f4fd0 0%, #1a6ef0 45%, #3ea0ff 100%);
    overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}
.auth-brand::before { width: 220px; height: 220px; top: -70px; right: -60px; }
.auth-brand::after  { width: 160px; height: 160px; bottom: -50px; left: -40px; background: rgba(255,255,255,.09); }

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}
.auth-logo span { font-size: 1rem; font-weight: 800; letter-spacing: .5px; }

.auth-brand-title {
    margin: 20px 0 10px;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.25;
}

.auth-brand-desc {
    margin: 0 0 26px;
    font-size: .88rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

.auth-brand-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-brand-list li { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: rgba(255,255,255,.92); }
.auth-brand-list i { font-size: 1.05rem; opacity: .95; }

/* ---------- Form column ---------- */
.auth-form-wrap { padding: 40px 38px 32px; display: flex; flex-direction: column; }
.auth-card { flex: 1; display: flex; flex-direction: column; }

.auth-header { text-align: center; margin-bottom: 26px; }

.auth-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(145deg, #edf4ff, #dce9ff);
    color: #1668d8;
    font-size: 1.3rem;
    margin-bottom: 14px;
}

.auth-title { margin: 0 0 6px; font-size: 1.42rem; font-weight: 700; color: #16203a; }
.auth-subtitle { margin: 0; font-size: .84rem; color: #7c879e; }

.auth-body { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Fields ---------- */
.field { display: block; }

.field-control { position: relative; }

.field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #9aa5bb;
    transition: color .25s ease;
    pointer-events: none;
    z-index: 2;
}

.field-input {
    width: 100%;
    height: 56px;
    padding: 22px 44px 8px 44px;
    border: 1.5px solid #e3e8f2;
    border-radius: 14px;
    background: #fbfcfe;
    font-size: .95rem;
    color: #16203a;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.field-input:focus {
    outline: none;
    background: #fff;
    border-color: #3b8af0;
    box-shadow: 0 0 0 4px rgba(59, 138, 240, .12);
}

.field-control:focus-within .field-icon { color: #1668d8; }

.field-label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .93rem;
    color: #9aa5bb;
    pointer-events: none;
    transition: all .22s cubic-bezier(.2, .7, .3, 1);
    z-index: 2;
}

.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
    top: 9px;
    transform: translateY(0);
    font-size: .68rem;
    color: #1668d8;
    font-weight: 600;
}

.field-line {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b8af0, #6ba8ff);
    transform: scaleX(0);
    transition: transform .3s ease;
}
.field-control:focus-within .field-line { transform: scaleX(1); }

.field-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #9aa5bb;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}
.field-toggle:hover { color: #1668d8; background: #eef4ff; }

.field-error { display: block; margin-top: 6px; font-size: .74rem; color: #e5484d; }

.field-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: .74rem;
    color: #16a34a;
}
.field-hint[hidden] { display: none; }
.field-hint.is-error { color: #e5484d; }

/* ---------- Password strength ---------- */
.pw-meter { margin-top: 9px; }
.pw-meter-track { height: 4px; border-radius: 3px; background: #e9edf5; overflow: hidden; }
.pw-meter-bar { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .3s ease, background .3s ease; }
.pw-meter-text { display: block; margin-top: 5px; font-size: .7rem; color: #8b95ab; }

/* ---------- Checkbox ---------- */
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }

.check-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid #d3dbea;
    border-radius: 6px;
    background: #fff;
    transition: all .22s ease;
    flex: none;
}
.check-row input:checked + .check-box { background: #1668d8; border-color: #1668d8; }
.check-box-mark {
    width: 10px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform .22s ease;
    margin-top: -2px;
}
.check-row input:checked + .check-box .check-box-mark { transform: rotate(-45deg) scale(1); }
.check-label { font-size: .84rem; color: #55607a; }

/* ---------- reCAPTCHA status ---------- */
.rc-wrap { margin-top: 2px; }

.rc-verify {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid #e3e8f2;
    background: #fbfcfe;
    font-size: .8rem;
    color: #7c879e;
    transition: all .3s ease;
}

.rc-verify-dot {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.rc-verify-spinner {
    width: 16px;
    height: 16px;
    flex: none;
    border: 2px solid #d8e2f2;
    border-top-color: #1668d8;
    border-radius: 50%;
    animation: rcSpin .8s linear infinite;
}
@keyframes rcSpin { to { transform: rotate(360deg); } }

.rc-verify-check { display: none; font-size: 1.05rem; color: #16a34a; }

.rc-verify-retry {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #1668d8;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.rc-verify-retry:hover { text-decoration: underline; }

/* pending */
.rc-verify[data-state="pending"] { border-color: #dbe6f7; background: #f7fafe; color: #5a6580; }
/* ok */
.rc-verify[data-state="ok"] { border-color: #bfe8cd; background: #f1fbf4; color: #15803d; }
.rc-verify[data-state="ok"] .rc-verify-spinner { display: none; }
.rc-verify[data-state="ok"] .rc-verify-check { display: inline-block; }
.rc-verify[data-state="ok"] .rc-verify-dot { display: block; background: #16a34a; }
/* error */
.rc-verify[data-state="error"] { border-color: #f5c2c4; background: #fef4f4; color: #c5303a; }
.rc-verify[data-state="error"] .rc-verify-spinner { display: none; }
.rc-verify[data-state="error"] .rc-verify-retry { display: inline-block; }

/* ---------- Buttons ---------- */
.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #1668d8, #3b8af0);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(22, 104, 216, .28);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(22, 104, 216, .34); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { cursor: not-allowed; opacity: .8; }

.btn-label { position: relative; z-index: 2; display: inline-flex; align-items: center; }

.btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}
.btn-primary.is-loading .btn-label { visibility: hidden; }
.btn-primary.is-loading .btn-loader {
    display: flex;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rcSpin .8s linear infinite;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1.5px solid #dbe3f0;
    border-radius: 14px;
    background: #fff;
    color: #1668d8;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .22s ease;
}
.btn-outline:hover { border-color: #1668d8; background: #f5f9ff; }

/* ---------- Switch link ---------- */
.auth-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    font-size: .84rem;
    color: #7c879e;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1668d8;
    font-weight: 600;
    text-decoration: none;
    transition: gap .2s ease;
}
.auth-link:hover { gap: 8px; }

.auth-foot-note {
    margin: 18px 0 0;
    text-align: center;
    font-size: .74rem;
    color: #9aa5bb;
}
.auth-foot-note i { margin-right: 4px; }

/* ---------- Flash alerts inside auth card ---------- */
.auth-body .alert {
    border: 0;
    border-radius: 12px;
    font-size: .82rem;
    padding: 12px 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
    .auth-layout { grid-template-columns: 1fr; max-width: 460px; }
    .auth-brand { display: none; }
    .auth-form-wrap { padding: 30px 24px 26px; }
}

@media (max-width: 575.98px) {
    .auth-shell { min-height: 0; padding: 8px 0 20px; }
    .auth-layout { border-radius: 20px; box-shadow: 0 10px 30px rgba(24, 45, 90, .08); }
    .auth-form-wrap { padding: 24px 18px 22px; }
    .auth-title { font-size: 1.25rem; }
    .auth-icon-circle { width: 46px; height: 46px; font-size: 1.15rem; }
    .field-input { height: 52px; padding: 18px 42px 6px 42px; font-size: 16px; }
    .btn-primary { height: 50px; }
    .field-icon { left: 14px; font-size: .95rem; }
    .field-label { left: 42px; font-size: .9rem; }
    .field-toggle { right: 10px; }
}
