/*
 * Modern authentication surfaces
 * Shared visual system with the public landing page.
 */

.auth-modern-page {
    --auth-accent: #2ca58d;
    --auth-accent-light: #39b9a0;
    --auth-ink: #111936;
    --auth-muted: #657080;
    --auth-border: rgba(17, 25, 54, 0.12);
    min-width: 320px;
    overflow-x: hidden;
    background: #fff;
    color: var(--auth-ink);
}

.auth-modern-page .auth-main,
.auth-modern-page .auth-wrapper {
    min-height: 100svh;
}

.auth-modern-page .auth-modern-shell {
    display: grid !important;
    grid-template-columns: minmax(520px, 1.05fr) minmax(430px, 0.95fr);
    align-items: stretch !important;
    background: #fff;
}

.auth-modern-page .auth-form {
    position: relative;
    display: block !important;
    min-width: 0;
    min-height: 100svh;
    padding: clamp(28px, 4.2vw, 68px);
    background:
        radial-gradient(circle at 4% 8%, rgba(44, 165, 141, 0.1), transparent 28%),
        radial-gradient(circle at 94% 92%, rgba(17, 25, 54, 0.06), transparent 30%),
        #fff;
}

.auth-modern-page .auth-form-inner {
    display: flex;
    width: min(100%, 660px);
    min-height: calc(100svh - clamp(56px, 8.4vw, 136px));
    margin: 0 auto;
    flex-direction: column;
    justify-content: center;
}

.auth-modern-page .auth-wrapper.v2 .auth-form .logo {
    position: static;
    width: auto;
    max-width: none;
    margin-bottom: 30px;
    padding: 0;
}

.auth-modern-page .auth-wrapper.v2 .auth-form .logo a {
    display: inline-flex;
}

.auth-modern-page .auth-wrapper.v2 .auth-form .logo img {
    width: auto;
    max-width: 210px;
    max-height: 58px;
    padding: 0;
}

.auth-modern-page .auth-form .card,
.auth-modern-page .auth-wrapper.v2 .logo + .card {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 70px rgba(17, 25, 54, 0.1);
    backdrop-filter: blur(16px);
}

.auth-modern-page .auth-form .card-body {
    padding: clamp(28px, 4vw, 46px);
}

.auth-modern-page .auth-header {
    display: block !important;
    margin-bottom: 30px;
    text-align: left;
}

.auth-modern-page .auth-header h1,
.auth-modern-page .auth-header h2 {
    margin: 0;
    color: var(--auth-ink) !important;
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.auth-modern-page .auth-header p {
    margin: 10px 0 0 !important;
    color: var(--auth-muted);
    font-size: 0.98rem !important;
    line-height: 1.6;
}

.auth-modern-page .auth-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.auth-modern-page .auth-field-grid .form-floating,
.auth-modern-page .auth-field-grid .form-group {
    min-width: 0;
    margin: 0 !important;
}

.auth-modern-page .form-floating > .form-control,
.auth-modern-page .form-group > .form-control {
    min-height: 56px;
    border: 1px solid rgba(17, 25, 54, 0.15);
    border-radius: 14px;
    background-color: rgba(248, 250, 251, 0.9);
    color: var(--auth-ink);
    font-size: 0.95rem;
    box-shadow: none;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.auth-modern-page .form-floating > .form-control {
    height: 58px;
}

.auth-modern-page .form-group > .form-control {
    padding: 0 16px;
}

.auth-modern-page .form-floating > label,
.auth-modern-page .form-group > .form-label {
    color: rgba(17, 25, 54, 0.58);
    font-size: 0.88rem;
}

.auth-modern-page .form-group > .form-label {
    margin-bottom: 7px;
    font-weight: 600;
}

.auth-modern-page .form-control:hover {
    border-color: rgba(44, 165, 141, 0.4);
}

.auth-modern-page .form-control:focus {
    border-color: var(--auth-accent);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(44, 165, 141, 0.11);
}

.auth-modern-page .form-check-input {
    border-color: rgba(17, 25, 54, 0.24);
}

.auth-modern-page .form-check-input:checked {
    border-color: var(--auth-accent);
    background-color: var(--auth-accent);
}

.auth-modern-page .auth-options {
    gap: 16px;
    margin-top: 2px !important;
}

.auth-modern-page .auth-options a,
.auth-modern-page .auth-switch a,
.auth-modern-page .auth-terms a {
    color: #217f70 !important;
    font-weight: 600;
    text-decoration: none !important;
}

.auth-modern-page .auth-options a:hover,
.auth-modern-page .auth-options a:focus,
.auth-modern-page .auth-switch a:hover,
.auth-modern-page .auth-switch a:focus,
.auth-modern-page .auth-terms a:hover,
.auth-modern-page .auth-terms a:focus {
    color: var(--auth-ink) !important;
}

.auth-modern-page .auth-primary-btn {
    min-height: 52px;
    border: 1px solid rgba(44, 165, 141, 0.42) !important;
    border-radius: 14px;
    background: linear-gradient(135deg, #39b9a0 8%, #226b78 92%) !important;
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none !important;
    transition: transform 180ms ease, background-position 220ms ease;
}

.auth-modern-page .auth-primary-btn:hover,
.auth-modern-page .auth-primary-btn:focus {
    background-position: 100% 50% !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.auth-modern-page .auth-google-btn {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    border: 1px solid rgba(17, 25, 54, 0.16);
    border-radius: 12px;
    background: #fff;
    color: #111936;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-modern-page .auth-language-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--auth-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-modern-page .auth-language-switcher a {
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-modern-page .auth-language-switcher a.active,
.auth-modern-page .auth-language-switcher a:hover,
.auth-modern-page .auth-language-switcher a:focus {
    color: var(--auth-accent);
}

.auth-modern-page .auth-google-btn:hover,
.auth-modern-page .auth-google-btn:focus {
    border-color: rgba(66, 133, 244, 0.55);
    color: #111936;
    box-shadow: 0 8px 22px rgba(17, 25, 54, 0.1);
    transform: translateY(-1px);
}

.auth-modern-page .auth-google-btn svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.auth-modern-page .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--auth-muted);
    font-size: 0.75rem;
    text-align: center;
}

.auth-modern-page .auth-divider::before,
.auth-modern-page .auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(17, 25, 54, 0.12);
}

.auth-modern-page .auth-divider span {
    flex: 0 1 auto;
}

.auth-modern-page .auth-switch {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(17, 25, 54, 0.09);
    color: var(--auth-muted);
    font-size: 0.9rem;
    text-align: center;
}

.auth-modern-page .auth-home-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin-top: 22px;
    color: rgba(17, 25, 54, 0.66);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-modern-page .auth-home-link:hover,
.auth-modern-page .auth-home-link:focus {
    color: var(--auth-accent);
}

.auth-modern-page .auth-sidecontent {
    position: sticky !important;
    top: 0;
    display: block !important;
    width: auto !important;
    height: 100svh;
    min-width: 0;
    overflow: hidden;
    background: var(--auth-ink) !important;
}

.auth-modern-page .auth-sidecontent::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(180deg, transparent 38%, rgba(17, 25, 54, 0.18) 62%, rgba(17, 25, 54, 0.9) 100%),
        linear-gradient(90deg, rgba(17, 25, 54, 0.08), transparent 34%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: cover !important;
    opacity: 1 !important;
}

.auth-modern-page .auth-real-image {
    position: absolute !important;
    inset: 0;
    z-index: 0 !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.auth-modern-page.auth-login-page .auth-real-image {
    object-position: center 42%;
}

.auth-modern-page.auth-register-page .auth-real-image {
    object-position: center 38%;
}

.auth-modern-page .auth-visual-copy {
    position: absolute !important;
    right: clamp(28px, 4vw, 64px);
    bottom: clamp(30px, 5vw, 72px);
    left: clamp(28px, 4vw, 64px);
    z-index: 2 !important;
    color: #fff;
}

.auth-modern-page .auth-visual-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: rgba(44, 165, 141, 0.26);
    backdrop-filter: blur(10px);
}

.auth-modern-page .auth-visual-icon i {
    color: #9be5d6;
    font-size: 1.55rem;
}

.auth-modern-page .auth-visual-copy h2 {
    max-width: 590px;
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 3.3vw, 3.45rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.auth-modern-page .auth-visual-copy p {
    max-width: 560px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    line-height: 1.65;
}

.auth-modern-page .auth-visual-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 600;
}

.auth-modern-page .auth-visual-proof span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.auth-modern-page .auth-visual-proof i {
    color: #76d6c4;
    font-size: 1rem;
}

.auth-modern-page .alert {
    border: 0;
    border-radius: 12px;
    font-size: 0.88rem;
}

.auth-modern-page .text-danger {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
}

.auth-modern-page .auth-terms {
    margin-top: 18px;
}

.auth-modern-page .auth-terms .form-check-label {
    color: var(--auth-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 1199.98px) {
    .auth-modern-page .auth-modern-shell {
        grid-template-columns: minmax(500px, 1.08fr) minmax(390px, 0.92fr);
    }

    .auth-modern-page .auth-form {
        padding: 32px;
    }

    .auth-modern-page .auth-form .card-body {
        padding: 32px;
    }
}

@media (min-width: 992px) and (max-height: 820px) {
    .auth-modern-page.auth-login-page .auth-form {
        padding: 20px 36px;
    }

    .auth-modern-page.auth-login-page .auth-form-inner {
        min-height: calc(100svh - 40px);
    }

    .auth-modern-page.auth-login-page .auth-wrapper.v2 .auth-form .logo {
        margin-bottom: 16px;
    }

    .auth-modern-page.auth-login-page .auth-wrapper.v2 .auth-form .logo img {
        max-width: 176px;
        max-height: 46px;
    }

    .auth-modern-page.auth-login-page .auth-form .card-body {
        padding: 32px;
    }

    .auth-modern-page.auth-login-page .auth-header {
        margin-bottom: 24px;
    }

    .auth-modern-page.auth-login-page .auth-home-link {
        margin-top: 16px;
    }

    .auth-modern-page.auth-register-page .auth-form {
        padding: 20px 36px;
    }

    .auth-modern-page.auth-register-page .auth-form-inner {
        min-height: calc(100svh - 40px);
        justify-content: flex-start;
    }

    .auth-modern-page.auth-register-page .auth-wrapper.v2 .auth-form .logo {
        margin-bottom: 14px;
    }

    .auth-modern-page.auth-register-page .auth-wrapper.v2 .auth-form .logo img {
        max-width: 176px;
        max-height: 46px;
    }

    .auth-modern-page.auth-register-page .auth-form .card-body {
        padding: 24px 30px;
    }

    .auth-modern-page.auth-register-page .auth-header {
        margin-bottom: 18px;
    }

    .auth-modern-page.auth-register-page .auth-header h1 {
        font-size: 2.05rem;
    }

    .auth-modern-page.auth-register-page .auth-header p {
        margin-top: 7px !important;
    }

    .auth-modern-page.auth-register-page .auth-field-grid {
        gap: 12px 14px;
    }

    .auth-modern-page.auth-register-page .form-floating > .form-control {
        height: 54px;
        min-height: 54px;
    }

    .auth-modern-page.auth-register-page .form-group > .form-control {
        min-height: 52px;
    }

    .auth-modern-page.auth-register-page .auth-terms {
        margin-top: 14px;
    }

    .auth-modern-page.auth-register-page .d-grid.mt-4 {
        margin-top: 18px !important;
    }

    .auth-modern-page.auth-register-page .auth-primary-btn {
        min-height: 48px;
    }

    .auth-modern-page.auth-register-page .auth-switch {
        margin-top: 18px;
        padding-top: 16px;
    }

    .auth-modern-page.auth-register-page .auth-home-link {
        margin-top: 14px;
    }
}

@media (max-width: 991.98px) {
    .auth-modern-page .auth-modern-shell {
        display: block !important;
    }

    .auth-modern-page .auth-form {
        min-height: 100svh;
        padding: 28px 20px;
    }

    .auth-modern-page .auth-form-inner {
        min-height: calc(100svh - 56px);
    }

    .auth-modern-page .auth-sidecontent {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .auth-modern-page .auth-form {
        padding: 20px 14px;
    }

    .auth-modern-page .auth-form-inner {
        min-height: calc(100svh - 40px);
    }

    .auth-modern-page .auth-wrapper.v2 .auth-form .logo {
        margin-bottom: 22px;
    }

    .auth-modern-page .auth-wrapper.v2 .auth-form .logo img {
        max-width: 176px;
        max-height: 50px;
    }

    .auth-modern-page .auth-form .card {
        border-radius: 19px;
    }

    .auth-modern-page .auth-form .card-body {
        padding: 26px 20px;
    }

    .auth-modern-page .auth-header {
        margin-bottom: 24px;
    }

    .auth-modern-page .auth-header h1,
    .auth-modern-page .auth-header h2 {
        font-size: 2rem;
    }

    .auth-modern-page .auth-field-grid {
        grid-template-columns: 1fr;
    }

    .auth-modern-page .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-modern-page *,
    .auth-modern-page *::before,
    .auth-modern-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
