/* Shared login/signup layout: visual story panel, accessible form controls,
   feedback states, password toggles, and responsive stacking. */

body.auth {
    background: #f7f7fc;
    color: #18192d;
    font-family: 'DM Sans', sans-serif;
}

.auth-main {
    position: relative;
    isolation: isolate;
    flex: 1 0 auto;
    padding: clamp(42px, 6vw, 76px) 24px clamp(64px, 8vw, 100px);
    overflow: hidden;
    background:
        radial-gradient(circle at 7% 14%, rgba(102, 88, 232, .08), transparent 24rem),
        radial-gradient(circle at 94% 84%, rgba(89, 124, 210, .08), transparent 28rem),
        #f7f7fc;
}

.auth-main::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .42;
    background:
        radial-gradient(circle at 8% 22%, #6658e8 0 1px, transparent 1.7px),
        radial-gradient(circle at 18% 76%, #8198d7 0 1px, transparent 1.7px),
        radial-gradient(circle at 47% 12%, #6658e8 0 1px, transparent 1.7px),
        radial-gradient(circle at 73% 86%, #8198d7 0 1px, transparent 1.7px),
        radial-gradient(circle at 91% 28%, #6658e8 0 1px, transparent 1.7px);
    content: '';
    pointer-events: none;
}

.auth-shell {
    width: min(100%, 1120px);
    min-height: 630px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(350px, .88fr) minmax(0, 1.12fr);
    overflow: hidden;
    border: 1px solid #e2e1ec;
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(31, 24, 82, .13);
}

.signup .auth-shell { min-height: 720px; }

/* Branded image panel used opposite the credential form. */
.auth-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(36px, 5vw, 58px);
    display: flex;
    align-items: flex-end;
    color: #fff;
    background-position: center;
    background-size: cover;
}

.login .auth-visual {
    background-image:
        linear-gradient(180deg, rgba(7, 9, 28, .12), rgba(7, 9, 28, .9)),
        url('../images/main_4.jpg');
}

.signup .auth-visual {
    background-image:
        linear-gradient(180deg, rgba(7, 9, 28, .1), rgba(7, 9, 28, .92)),
        url('../images/nebu.jpg');
}

.auth-visual::before {
    position: absolute;
    z-index: -1;
    width: 430px;
    height: 220px;
    right: -130px;
    top: 70px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    box-shadow: 0 0 0 44px rgba(255,255,255,.035);
    transform: rotate(-24deg);
    content: '';
}

.auth-visual::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .54;
    background:
        radial-gradient(circle at 10% 13%, #fff 0 1px, transparent 1.6px),
        radial-gradient(circle at 74% 18%, #fff 0 1px, transparent 1.6px),
        radial-gradient(circle at 91% 45%, #c9c2ff 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 24% 67%, #fff 0 1px, transparent 1.6px),
        radial-gradient(circle at 68% 82%, #c9c2ff 0 1px, transparent 1.7px);
    content: '';
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 390px;
}

.auth-symbol {
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 17px;
    background: rgba(255,255,255,.1);
    color: #c5bdff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
}

.auth-visual h2 {
    margin: 0 0 17px;
    color: #fff;
    font-family: 'Platypi', serif;
    font-size: clamp(2.25rem, 4vw, 3.45rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1.02;
    text-wrap: balance;
}

.auth-visual p {
    margin: 0;
    color: #d0d2e5;
    font-size: .98rem;
    line-height: 1.7;
}

.auth-highlights {
    margin: 28px 0 0;
    padding: 24px 0 0;
    display: grid;
    gap: 13px;
    border-top: 1px solid rgba(255,255,255,.14);
    list-style: none;
}

.auth-highlights li {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #eef0ff;
    font-size: .84rem;
    font-weight: 650;
}

.auth-highlights i { width: 18px; color: #a99eff; text-align: center; }

/* Form-side panel and card hierarchy. */
.auth-panel {
    padding: clamp(38px, 5vw, 64px);
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.98);
}

.auth-card {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.auth-card-head { margin-bottom: 30px; }

.auth-card-head h1 {
    margin: 0 0 10px;
    color: #17182b;
    font-family: 'Platypi', serif;
    font-size: clamp(2.7rem, 5vw, 4rem);
    font-weight: 600;
    letter-spacing: -.055em;
    line-height: 1;
}

.auth-card-head p {
    margin: 0;
    color: #686b7d;
    font-size: .95rem;
    line-height: 1.65;
}

.auth-alert {
    margin: 0 0 22px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.5;
}

.auth-alert i { margin-top: 3px; }
.auth-alert p { margin: 0; }
.auth-alert-success { border-color: #b9dec8; background: #effaf3; color: #245f3d; }
.auth-alert-error { border-color: #e7c1c6; background: #fff3f4; color: #8c3441; }

.auth-form {
    display: grid;
    gap: 19px;
}

.required-note {
    margin: -13px 0 -4px;
    color: #7b7e8f;
    font-size: .76rem;
}

.auth-name-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.auth-field label {
    display: block;
    margin: 0 0 8px;
    color: #292b40;
    font-size: .83rem;
    font-weight: 700;
}

/* Icon, input, and password-toggle alignment. */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #dcdce7;
    border-radius: 14px;
    background: #fafafe;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-input-wrap > i {
    position: absolute;
    left: 15px;
    color: #83869a;
    font-size: .87rem;
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 43px;
    border: 0;
    outline: 0;
    border-radius: inherit;
    background: transparent;
    color: #1d1f33;
    font: 500 .94rem 'DM Sans', sans-serif;
}

.auth-input-wrap input::placeholder { color: #9799a8; }

.auth-input-wrap:hover { border-color: #beb9e1; background: #fff; }

.auth-input-wrap:focus-within {
    border-color: #7567e5;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 88, 232, .13);
}

.auth-input-wrap:focus-within > i { color: #6658e8; }

.password-toggle {
    position: absolute;
    right: 7px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #777a8d;
    cursor: pointer;
}

.password-toggle:hover { background: #efedfb; color: #5345c8; }
.password-toggle:focus-visible { outline: 2px solid #7567e5; outline-offset: 2px; }

.field-help {
    margin: 7px 0 0;
    color: #777a8d;
    font-size: .75rem;
}

.auth-submit {
    min-height: 54px;
    margin-top: 3px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 1px solid #5d4fd8;
    border-radius: 14px;
    background: #6658e8;
    color: #fff;
    font: 700 .94rem 'DM Sans', sans-serif;
    box-shadow: 0 12px 28px rgba(82, 65, 200, .22);
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-submit:hover {
    background: #5547d2;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(82, 65, 200, .3);
}

.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible { outline: 3px solid rgba(102, 88, 232, .28); outline-offset: 3px; }

.auth-submit i { font-size: .8rem; }

.auth-switch {
    margin: 24px 0 0;
    color: #717487;
    font-size: .83rem;
    text-align: center;
}

.auth-switch a {
    color: #5143c7;
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover { color: #382ba8; text-decoration: underline; }
.auth-switch a:focus-visible { outline: 2px solid #7567e5; outline-offset: 3px; border-radius: 3px; }

@media (max-width: 900px) {
    .auth-shell,
    .signup .auth-shell {
        max-width: 660px;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 300px;
        padding: 38px;
    }

    .auth-visual-content { max-width: 470px; }
    .auth-visual h2 { font-size: clamp(2.25rem, 8vw, 3.35rem); }
    .auth-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-panel { padding: 46px 38px 52px; }
}

@media (max-width: 560px) {
    .auth-main { padding: 22px 12px 54px; }
    .auth-shell { border-radius: 22px; }
    .auth-visual { min-height: 230px; padding: 28px 24px; }
    .auth-symbol { width: 44px; height: 44px; margin-bottom: 17px; border-radius: 14px; }
    .auth-visual h2 { margin-bottom: 11px; font-size: clamp(2rem, 10vw, 2.65rem); }
    .auth-visual p { font-size: .88rem; }
    .auth-highlights { display: none; }
    .auth-panel { padding: 34px 22px 40px; }
    .auth-card-head { margin-bottom: 25px; }
    .auth-card-head h1 { font-size: 2.65rem; }
    .auth-name-row { grid-template-columns: 1fr; gap: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input-wrap,
    .auth-submit,
    .auth-submit i { transition: none; }
}
