:root {
    --auth-primary: #526df6;
    --auth-primary-hover: #405de8;
    --auth-primary-soft: #edf1ff;
    --auth-text: #26324a;
    --auth-muted: #77849b;
    --auth-border: #e2e8f2;
}

html, body { min-height: 100%; }
body.modern-auth {
    min-height: 100vh;
    height: auto;
    padding: 32px;
    background:
        radial-gradient(circle at 10% 10%, rgba(82, 109, 246, .10), transparent 28%),
        radial-gradient(circle at 90% 90%, rgba(255, 166, 77, .11), transparent 27%),
        #f7f9fd;
    color: var(--auth-text);
}
.modern-auth .auth-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(330px, .86fr) minmax(430px, 1.14fr);
    width: min(1040px, 100%);
    min-height: 640px;
    overflow: hidden;
    border: 1px solid rgba(222, 229, 241, .9);
    border-radius: 26px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 80px rgba(61, 79, 119, .13);
}
.modern-auth.signup-page .auth-shell {
    grid-template-columns: minmax(310px, .72fr) minmax(600px, 1.28fr);
    width: min(1180px, 100%);
}
.modern-auth .auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px;
    background: linear-gradient(145deg, #edf2ff 0%, #f8faff 58%, #fff6ec 100%);
}
.modern-auth .auth-brand-panel::before,
.modern-auth .auth-brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.modern-auth .auth-brand-panel::before {
    top: -105px;
    right: -115px;
    width: 285px;
    height: 285px;
    border: 48px solid rgba(82, 109, 246, .07);
}
.modern-auth .auth-brand-panel::after {
    bottom: -120px;
    left: -115px;
    width: 285px;
    height: 285px;
    border: 50px solid rgba(255, 153, 51, .08);
}
.modern-auth .brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
    color: var(--auth-text);
    text-decoration: none;
}
.modern-auth .brand-logo img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    filter: drop-shadow(0 8px 13px rgba(66, 80, 120, .10));
}
.modern-auth .brand-logo span { font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; }
.modern-auth .brand-content { position: relative; z-index: 1; margin: auto 0; padding: 42px 0; }
.modern-auth .brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 7px 11px;
    border: 1px solid rgba(82, 109, 246, .13);
    border-radius: 20px;
    background: rgba(255, 255, 255, .7);
    color: var(--auth-primary);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.modern-auth .brand-content h2 {
    max-width: 330px;
    margin: 0 0 15px;
    color: var(--auth-text);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.18;
}
.modern-auth .brand-content > p { max-width: 340px; margin: 0; color: var(--auth-muted); font-size: .9rem; line-height: 1.75; }
.modern-auth .trust-points { position: relative; z-index: 1; display: grid; gap: 11px; }
.modern-auth .trust-point { display: flex; align-items: center; gap: 10px; color: #5f6d84; font-size: .77rem; font-weight: 600; }
.modern-auth .trust-point i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .86);
    color: var(--auth-primary);
    box-shadow: 0 5px 15px rgba(70, 88, 127, .07);
}
.modern-auth .auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 48px clamp(34px, 6vw, 72px); background: #fff; }
.modern-auth.signup-page .auth-form-panel { padding: 42px clamp(30px, 4vw, 58px); }
.modern-auth .login-box {
    width: 100%;
    max-width: 420px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.modern-auth.signup-page .login-box { max-width: 680px; }
.modern-auth .mobile-logo { display: none; margin-bottom: 24px; text-align: center; }
.modern-auth .mobile-logo img { width: 72px; height: 72px; }
.modern-auth .form-heading { margin-bottom: 27px; }
.modern-auth .form-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; color: var(--auth-primary); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.modern-auth .form-title { margin: 0 0 8px; color: var(--auth-text); font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; }
.modern-auth .form-subtitle { margin: 0; color: var(--auth-muted); font-size: .85rem; line-height: 1.65; }
.modern-auth .form-note { display: flex; align-items: flex-start; gap: 9px; margin: -7px 0 22px; padding: 11px 13px; border-radius: 11px; background: #fff7e9; color: #94681f; font-size: .73rem; line-height: 1.5; }
.modern-auth .form-note i { margin-top: 1px; }
.modern-auth .alert { margin-bottom: 20px; padding: 11px 38px 11px 13px; border: 0; border-radius: 11px; font-size: .76rem; }
.modern-auth .alert i { margin-right: 7px; }
.modern-auth .alert-danger { color: #b94f5a; background: #fff0f2; }
.modern-auth .alert-success { color: #237c60; background: #ebf8f3; }
.modern-auth .field-group { margin-bottom: 17px; }
.modern-auth .field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modern-auth .form-label { margin: 0; color: #526077; font-size: .74rem; font-weight: 700; }
.modern-auth .input-wrap { position: relative; }
.modern-auth .input-wrap > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    color: #94a0b4;
    font-size: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}
.modern-auth .input-wrap .form-control {
    width: 100%;
    height: 49px;
    padding: 11px 42px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text);
    background: #fbfcfe;
    font-size: .82rem;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.modern-auth .input-wrap .form-control::placeholder { color: #a7b1c2; }
.modern-auth .input-wrap .form-control:focus { border-color: #a9b7fb; background: #fff; box-shadow: 0 0 0 4px rgba(82, 109, 246, .09); }
.modern-auth .password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a97ac;
    transform: translateY(-50%);
}
.modern-auth .password-toggle:hover { background: var(--auth-primary-soft); color: var(--auth-primary); }
.modern-auth .location-status { display: flex; align-items: flex-start; gap: 8px; min-height: 22px; margin: -2px 0 16px; color: var(--auth-muted); font-size: .68rem; line-height: 1.45; }
.modern-auth .location-status i { margin-top: 1px; color: var(--auth-primary); }
.modern-auth .location-status.has-error,
.modern-auth .location-status.has-error i { color: #c35660; }
.modern-auth .login-form-actions { display: block; margin: 0; }
.modern-auth .login-form .primary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #fff;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 12px 24px rgba(82, 109, 246, .22);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.modern-auth .login-form .primary-action:hover { background: var(--auth-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(82, 109, 246, .27); }
.modern-auth .login-form-footer { margin: 24px 0 0; padding: 21px 0 0; border-top: 1px solid #edf0f5; }
.modern-auth .login-form .additional-link { justify-content: center; color: var(--auth-muted); font-size: .76rem; }
.modern-auth .login-form .additional-link a { margin-left: 6px; border: 0; color: var(--auth-primary); font-weight: 700; text-transform: none; text-decoration: none; }
.modern-auth .text-danger { margin: 6px 0 0; font-size: .69rem; }

@media (max-width: 900px) {
    body.modern-auth { padding: 22px; }
    .modern-auth .auth-shell,
    .modern-auth.signup-page .auth-shell { grid-template-columns: 1fr; width: min(650px, 100%); min-height: 0; }
    .modern-auth .auth-brand-panel { display: none; }
    .modern-auth .auth-form-panel,
    .modern-auth.signup-page .auth-form-panel { padding: 42px 36px; }
    .modern-auth .mobile-logo { display: block; }
    .modern-auth .form-heading { text-align: center; }
}
@media (max-width: 480px) {
    body.modern-auth { align-items: flex-start; padding: 14px; }
    .modern-auth .auth-shell { margin: auto 0; border-radius: 20px; }
    .modern-auth .auth-form-panel,
    .modern-auth.signup-page .auth-form-panel { padding: 30px 20px; }
    .modern-auth .mobile-logo { margin-bottom: 18px; }
    .modern-auth .mobile-logo img { width: 62px; height: 62px; }
    .modern-auth .form-title { font-size: 1.55rem; }
}
