:root {
    --navy-dark: #061a2d;
    --navy: #0d2c4e;
    --primary: #105f9a;
    --accent: #1570ad;
    --white: #ffffff;
    --background: #f2f6f9;
    --text: #172b3d;
    --muted: #6d7c89;
    --border: #d9e3eb;
    --danger: #b42318;
    --success: #18733f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(
            135deg,
            #f7fafc 0%,
            #edf3f7 100%
        );
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
}

.auth-page {
    min-height: 100vh;
    padding: 36px 20px;
    display: grid;
    place-items: center;
}

.back-home {
    position: fixed;
    top: 24px;
    left: 28px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(21, 85, 112, 0.15);
    border-radius: 10px;
    background: #ffffff;
    color: #155570;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(21, 85, 112, 0.08);
    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.back-home:hover {
    background: #155570;
    color: #ffffff;
    border-color: #155570;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(21, 85, 112, 0.22);
}

.back-home:active {
    transform: translateY(0);
}

.back-home svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-card {
    width: min(900px, 100%);
    min-height: 580px;
    display: grid;
    grid-template-columns:
        minmax(300px, 0.85fr)
        minmax(420px, 1.15fr);
    border: 1px solid rgba(13, 44, 78, 0.08);
    border-radius: 20px;
    background: var(--white);
    box-shadow:
        0 24px 60px
        rgba(13, 44, 78, 0.14);
    overflow: hidden;
}

.auth-side {
    position: relative;
    min-height: 100%;
    padding: 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--white);
    background:
        linear-gradient(
            145deg,
            #155570 0%,
            #155570 65%,
            #10475f 100%
        );
    overflow: hidden;
}

.auth-side::before,
.auth-side::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.auth-side::before {
    width: 280px;
    height: 280px;
    top: -155px;
    right: -145px;
}

.auth-side::after {
    width: 180px;
    height: 180px;
    right: -85px;
    bottom: -95px;
}

.auth-logo,
.auth-side-content,
.auth-copyright {
    position: relative;
    z-index: 2;
}

.auth-logo {
    position: relative;
    z-index: 2;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ffffff;
    text-decoration: none;
}

.auth-logo img {
    width: 190px;
    max-width: 100%;
    max-height: 75px;
    display: block;
    object-fit: contain;
}

.auth-side-content {
    margin: auto 0;
    padding: 40px 0;
}

.auth-label {
    display: inline-block;
    margin-bottom: 16px;
    color: #bfe3f7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-side h1 {
    max-width: 340px;
    margin-bottom: 16px;
    color: var(--white);
    font-size: 37px;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.auth-side p {
    max-width: 340px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    line-height: 1.7;
}

.auth-copyright {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
}

.auth-main {
    padding: 38px 44px 42px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 5px;
    border-radius: 10px;
    background: #edf2f6;
}

.auth-tab {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-tab.active {
    color: #155570;
    background: #ffffff;
    box-shadow:
        0 3px 10px
        rgba(21, 85, 112, 0.12);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
    animation: authPanelFade 0.25s ease;
}

@keyframes authPanelFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-heading {
    margin: 27px 0 23px;
}

.auth-heading h2 {
    margin-bottom: 7px;
    color: var(--navy);
    font-size: 27px;
    line-height: 1.2;
}

.auth-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    color: #293e50;
    font-size: 13px;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.label-row a {
    color: #155570;
    font-weight: 700;
    text-decoration: none;
}

.label-row a:hover {
    color: #11465c;
    text-decoration: underline;
}

.form-group input {
    width: 100%;
    min-height: 48px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    color: var(--text);
    background: var(--white);
    font-size: 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: #98a5af;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px
        rgba(21, 112, 173, 0.1);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: transparent;
    color: #75838f;
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.password-toggle:hover {
    color: var(--navy);
    background: #edf3f7;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle.showing .eye-open {
    display: none;
}

.password-toggle.showing .eye-closed {
    display: block;
}

.checkbox-label {
    width: fit-content;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-label input {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.submit-button {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid #155570;
    border-radius: 10px;
    background: #155570;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
}

.submit-button:hover {
    background: #11465c;
    border-color: #11465c;
    box-shadow:
        0 10px 25px
        rgba(21, 85, 112, 0.25);
    transform: translateY(-2px);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.submit-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px
        rgba(21, 85, 112, 0.2);
}

.auth-divider {
    position: relative;
    margin: 18px 0;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    position: relative;
    padding: 0 12px;
    background: var(--white);
    color: #8c98a3;
    font-size: 12px;
}

.google-button {
    width: 100%;
    min-height: 48px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.google-button:hover {
    background: #f7f9fb;
    border-color: #c8d5df;
}

.google-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.switch-text {
    margin-top: 20px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.switch-text button {
    padding: 0;
    background: transparent;
    color: #155570;
    font-weight: 700;
    text-decoration: none;
}

.switch-text button:hover {
    color: #11465c;
    text-decoration: underline;
}

.field-error,
.terms-error {
    display: none;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

.form-group.has-error input {
    border-color: var(--danger);
}

.form-group.has-error .field-error {
    display: block;
}

.auth-alert {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert-error {
    color: var(--danger);
    background: #fff1f0;
}

.auth-alert-success {
    color: var(--success);
    background: #eefaf3;
}

@media (max-width: 800px) {
    .auth-page {
        padding: 75px 16px 30px;
        place-items: start center;
    }

    .back-home {
        top: 20px;
        left: 18px;
    }

    .auth-card {
        width: min(560px, 100%);
        grid-template-columns: 1fr;
    }

    .auth-side {
        min-height: 250px;
        padding: 30px 26px;
    }

    .auth-side-content {
        padding: 35px 0 15px;
    }

    .auth-side h1 {
        max-width: 430px;
        font-size: 29px;
    }

    .auth-side p {
        max-width: 430px;
    }

    .auth-copyright {
        display: none;
    }

    .auth-main {
        padding: 30px 26px 34px;
    }
}

@media (max-width: 520px) {
    .auth-card {
        border-radius: 15px;
    }

    .auth-side {
        min-height: 225px;
        padding: 26px 22px;
    }

    .auth-logo img {
        width: 165px;
    }

    .auth-side-content {
        padding: 28px 0 8px;
    }

    .auth-side h1 {
        font-size: 26px;
    }

    .auth-main {
        padding: 26px 20px 30px;
    }

    .name-grid {
        grid-template-columns: 1fr;
    }

    .auth-heading h2 {
        font-size: 24px;
    }
}