html,
body {
    height: 100%;
    overflow: hidden;
}

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        linear-gradient(135deg, rgba(15, 76, 117, .10) 0 22%, transparent 22%),
        linear-gradient(315deg, rgba(46, 139, 124, .12) 0 20%, transparent 20%),
        linear-gradient(180deg, #f7fbff 0%, #eef7f4 52%, #f8fbff 100%);
    color: #1f2937;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.auth-page::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 76, 117, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 139, 124, .05) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(130deg, rgba(0,0,0,.85), transparent 62%);
}

.auth-page::after {
    width: 44vw;
    height: 44vw;
    right: -18vw;
    bottom: -24vw;
    border: 80px solid rgba(245, 158, 11, .12);
    border-radius: 50%;
}

.auth-page form,
.auth-shell {
    position: relative;
    z-index: 1;
}

.auth-shell {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    padding: clamp(10px, 2.4vh, 22px) 0;
}

.auth-frame {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(300px, .95fr) minmax(360px, 440px);
    align-items: stretch;
    gap: clamp(14px, 2vw, 24px);
}

.auth-visual,
.auth-card {
    border: 1px solid rgba(31, 41, 55, .10);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 76, 117, .12);
}

.auth-visual {
    min-height: 0;
    padding: clamp(22px, 3vw, 36px);
    background:
        linear-gradient(135deg, rgba(15, 76, 117, .94), rgba(34, 116, 101, .90)),
        url("../images/setup-analytics-amico.svg") right 7% bottom 8% / min(48%, 320px) no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-visual img {
    height: clamp(46px, 7vh, 64px);
    width: fit-content;
    max-width: 220px;
    background: rgba(255,255,255,.94);
    border-radius: 8px;
    padding: 8px 12px;
}

.auth-visual h1 {
    margin: clamp(22px, 6vh, 54px) 0 10px;
    max-width: 520px;
    font-size: clamp(27px, 4vw, 44px);
    line-height: 1.04;
    letter-spacing: 0;
}

.auth-visual p {
    max-width: 460px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: clamp(14px, 1.45vw, 16px);
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: clamp(26px, 7vh, 64px);
}

.auth-metric {
    padding: 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255,255,255,.10);
}

.auth-metric strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.auth-metric span {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,.74);
    font-size: 12px;
}

.auth-card {
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.auth-card-body {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 3vh, 30px);
}

.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 8px;
}

.auth-mobile-logo img {
    height: 46px;
}

.auth-title {
    margin-bottom: clamp(14px, 2.2vh, 22px);
}

.auth-title h5 {
    margin-bottom: 5px;
    color: #0f4c75;
    font-size: clamp(18px, 2.7vh, 22px);
    font-weight: 700;
}

.auth-title p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.auth-fields {
    display: grid;
    gap: clamp(9px, 1.45vh, 14px);
}

.auth-register .auth-fields {
    gap: clamp(7px, 1.05vh, 10px);
}

.auth-page .form-label,
.auth-page label {
    margin-bottom: 4px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.auth-page .form-control {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1f2937;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.auth-page .form-control:focus {
    border-color: #2e8b7c;
    box-shadow: 0 0 0 3px rgba(46, 139, 124, .14);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
}

.auth-page .form-check {
    min-height: 0;
    margin-top: 2px;
}

.auth-page .form-check-input {
    border-color: #94a3b8;
}

.auth-page .form-check-input:checked {
    background-color: #0f4c75;
    border-color: #0f4c75;
}

.auth-page .btn-primary {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #0f4c75, #2e8b7c);
    box-shadow: 0 12px 20px rgba(15, 76, 117, .18);
    font-weight: 700;
}

.auth-page .btn-primary:hover,
.auth-page .btn-primary:focus {
    background: linear-gradient(135deg, #0b3b5c, #257466);
}

.auth-action {
    margin-top: clamp(12px, 2vh, 18px);
    display: flex;
    justify-content: flex-end;
}

.auth-action .btn {
    width: 100%;
}

.auth-switch {
    margin: clamp(12px, 2vh, 18px) 0 0;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.auth-switch a,
.auth-page a {
    color: #0f4c75;
}

.auth-footer {
    margin-top: auto;
    padding-top: clamp(12px, 2vh, 20px);
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.auth-login .auth-card-body {
    min-height: min(620px, calc(100vh - 44px));
}

.auth-register .auth-frame {
    grid-template-columns: minmax(300px, .82fr) minmax(390px, 480px);
}

.auth-register .auth-card-body {
    padding: clamp(16px, 2.15vh, 24px);
}

@media (max-height: 720px) {
    .auth-visual {
        padding: 22px;
        background-size: min(38%, 240px);
    }

    .auth-visual h1 {
        font-size: 32px;
        margin-top: 24px;
    }

    .auth-metrics {
        margin-top: 24px;
    }

    .auth-card-body {
        padding: 18px;
    }

    .auth-page .form-control,
    .auth-page .btn-primary {
        min-height: 38px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .auth-title {
        margin-bottom: 12px;
    }
}

@media (max-width: 991.98px) {
    .auth-shell {
        padding: 10px 0;
    }

    .auth-frame {
        width: min(520px, calc(100% - 20px));
        grid-template-columns: 1fr;
    }

    .auth-register .auth-frame {
        width: min(520px, calc(100% - 20px));
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .auth-mobile-logo {
        display: block;
    }

    .auth-card-body {
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px);
    }

    .auth-register .auth-card {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .auth-frame {
        width: calc(100% - 16px);
    }

    .auth-register .auth-frame {
        width: calc(100% - 16px);
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-register .auth-card {
        min-width: 0;
    }

    .auth-card-body {
        padding: 14px;
    }

    .auth-register .auth-card-body {
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px);
    }

    .auth-mobile-logo {
        margin-bottom: 6px;
    }

    .auth-mobile-logo img {
        height: 40px;
    }

    .auth-title h5 {
        font-size: 18px;
    }

    .auth-title p,
    .auth-switch {
        font-size: 13px;
    }

    .auth-page .form-label,
    .auth-page label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .auth-page .form-control,
    .auth-page .btn-primary {
        min-height: 36px;
        font-size: 13px;
    }

    .auth-fields {
        gap: 8px;
    }

    .auth-footer {
        padding-top: 10px;
        font-size: 11px;
    }
}

@media (max-height: 610px) and (max-width: 991.98px) {
    .auth-shell {
        padding: 6px 0;
    }

    .auth-card-body {
        height: calc(100vh - 12px);
        height: calc(100dvh - 12px);
        padding: 10px 12px;
    }

    .auth-mobile-logo img {
        height: 32px;
    }

    .auth-title {
        margin-bottom: 8px;
    }

    .auth-title p,
    .auth-footer {
        display: none;
    }

    .auth-page .form-control,
    .auth-page .btn-primary {
        min-height: 32px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .auth-register .auth-fields {
        gap: 5px;
    }

    .auth-action,
    .auth-switch {
        margin-top: 8px;
    }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 991.98px) {
    .auth-register .auth-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 5px;
    }

    .auth-register .auth-terms {
        grid-column: 1 / -1;
    }

    .auth-register .auth-mobile-logo {
        display: none;
    }
}
