/* =========================================================
   HighPassCV - Authentication Page
   Styles for login, sign-up, verification, and password reset
   ========================================================= */

:root {
    --auth-primary: #002d62;
    --auth-primary-dark: #001f44;
    --auth-accent: #c5a059;
    --auth-accent-hover: #d4b982;
    --auth-text: #263244;
    --auth-text-light: #667085;
    --auth-white: #ffffff;
    --auth-bg: #f4f7fa;
    --auth-border: #dce4ec;
    --auth-error: #b42318;
    --auth-success: #067647;
    --auth-heading-font: "Poppins", sans-serif;
    --auth-body-font: "Inter", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 10% 10%, rgba(197, 160, 89, 0.14), transparent 26%),
        radial-gradient(circle at 90% 90%, rgba(0, 45, 98, 0.12), transparent 28%),
        linear-gradient(135deg, #f8fafc 0%, #eaf0f6 100%);
    font-family: var(--auth-body-font);
    line-height: 1.55;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--auth-primary);
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

/* =========================
   Main Layout
   ========================= */

.auth-wrapper {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 36px;
}

.auth-container {
    display: grid;
    grid-template-columns: minmax(340px, 0.92fr) minmax(440px, 1.08fr);
    width: min(1120px, 100%);
    min-height: 680px;
    overflow: hidden;
    border: 1px solid rgba(0, 45, 98, 0.08);
    border-radius: 26px;
    background: var(--auth-white);
    box-shadow: 0 32px 80px rgba(0, 31, 68, 0.16);
}

/* =========================
   Brand Panel
   ========================= */

.auth-info {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: 74px 58px 58px;
    color: var(--auth-white);
    background:
        radial-gradient(circle at 88% 12%, rgba(197, 160, 89, 0.26), transparent 24%),
        radial-gradient(circle at 10% 90%, rgba(197, 160, 89, 0.14), transparent 30%),
        var(--auth-primary);
}

.auth-info::before,
.auth-info::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.auth-info::before {
    top: -120px;
    right: -130px;
    width: 330px;
    height: 330px;
}

.auth-info::after {
    bottom: -180px;
    left: -150px;
    width: 390px;
    height: 390px;
}

.auth-info > * {
    position: relative;
    z-index: 1;
}

.back-home {
    position: absolute;
    top: 30px;
    left: 34px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.22s ease, transform 0.22s ease;
}

.back-home:hover,
.back-home:focus-visible {
    color: var(--auth-accent);
    transform: translateX(-3px);
}

.auth-info .logo {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 12px;
    margin-bottom: 42px;
    color: var(--auth-white);
}

.auth-info .brand-logo {
    display: block;
    width: auto;
    height: 50px;
    object-fit: contain;
}

.auth-info .brand-name {
    color: var(--auth-white);
    font-family: var(--auth-heading-font);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
}

.auth-info h1 {
    max-width: 470px;
    margin: 0 0 20px;
    color: var(--auth-white);
    font-family: var(--auth-heading-font);
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.22;
    letter-spacing: -0.035em;
}

.auth-info > p {
    max-width: 500px;
    margin: 0 0 34px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
}

.auth-benefits {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.auth-benefits i {
    flex: 0 0 auto;
    margin-top: 4px;
    color: var(--auth-accent);
}

/* =========================
   Forms Panel
   ========================= */

.auth-forms {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 54px 62px;
    background: var(--auth-white);
}

.auth-tabs,
.standalone-form {
    width: min(100%, 510px);
}

.auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
}

/* Radio controls stay accessible to keyboards and screen readers. */
.auth-tabs > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.tab-label {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-bottom: 34px;
    color: var(--auth-text-light);
    border-bottom: 2px solid var(--auth-border);
    font-weight: 700;
    cursor: pointer;
    transition: color 0.22s ease;
}

.tab-label:hover {
    color: var(--auth-primary);
}

.tab-slider {
    position: absolute;
    top: 50px;
    left: 0;
    z-index: 3;
    width: 50%;
    height: 3px;
    border-radius: 999px;
    background: var(--auth-accent);
    transition: transform 0.3s ease;
}

#tab-login:checked + .tab-label,
#tab-signup:checked + .tab-label {
    color: var(--auth-primary);
}

#tab-signup:checked ~ .tab-slider {
    transform: translateX(100%);
}

#tab-login:focus-visible + .tab-label,
#tab-signup:focus-visible + .tab-label {
    outline: 3px solid rgba(197, 160, 89, 0.38);
    outline-offset: -4px;
}

.form-content {
    grid-column: 1 / -1;
    min-width: 0;
}

.auth-tabs .form-content {
    display: none;
}

#tab-login:checked ~ .login-form,
#tab-signup:checked ~ .signup-form {
    display: block;
    animation: authFade 0.28s ease;
}

.standalone-form:not([hidden]) {
    display: block;
    animation: authFade 0.28s ease;
}

@keyframes authFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-content h2 {
    margin: 0 0 8px;
    color: var(--auth-primary);
    font-family: var(--auth-heading-font);
    font-size: clamp(1.7rem, 3vw, 2.05rem);
    line-height: 1.25;
}

.form-subtitle {
    margin: 0 0 28px;
    color: var(--auth-text-light);
    font-size: 0.94rem;
}

/* =========================
   Selected Plan Notice
   ========================= */

.selected-plan-notice {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(197, 160, 89, 0.46);
    border-radius: 12px;
    color: var(--auth-primary);
    background: rgba(197, 160, 89, 0.11);
    font-size: 0.9rem;
}

.selected-plan-notice i {
    flex: 0 0 auto;
    margin-top: 3px;
    color: #9b7836;
}

.selected-plan-notice strong {
    font-weight: 800;
}

/* =========================
   Form Controls
   ========================= */

form {
    margin: 0;
}

.name-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group > i {
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 1;
    color: #7b8797;
    font-size: 0.9rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-group input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 15px 13px 46px;
    color: var(--auth-text);
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: var(--auth-white);
    font-size: 0.95rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.input-group input::placeholder {
    color: #98a2b3;
}

.input-group input:hover {
    border-color: #bdc8d5;
}

.input-group input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(0, 45, 98, 0.08);
}

.input-group input:focus + * {
    color: var(--auth-primary);
}

.otp-input-group input {
    padding-right: 46px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-align: center;
}

.password-help {
    margin: -5px 0 18px;
    color: var(--auth-text-light);
    font-size: 0.8rem;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 2px 0 22px;
    font-size: 0.87rem;
}

.form-options label,
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--auth-text-light);
    cursor: pointer;
}

.form-options input[type="checkbox"],
.terms-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    accent-color: var(--auth-primary);
}

.terms-checkbox {
    margin: 0 0 20px;
    font-size: 0.84rem;
    line-height: 1.5;
}

.terms-checkbox a {
    font-weight: 700;
}

.terms-checkbox a:hover,
.terms-checkbox a:focus-visible {
    color: #9b7836;
}

.link-button,
.secondary-action-button,
.section-back-button {
    padding: 0;
    color: var(--auth-primary);
    border: 0;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover,
.secondary-action-button:hover,
.section-back-button:hover {
    color: #9b7836;
}

.link-button:focus-visible,
.secondary-action-button:focus-visible,
.section-back-button:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(197, 160, 89, 0.42);
    outline-offset: 4px;
}

/* =========================
   Messages
   ========================= */

.form-message {
    min-height: 0;
    margin: 0;
    color: var(--auth-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.form-message:not(:empty) {
    min-height: 40px;
    margin: -2px 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 45, 98, 0.13);
    border-radius: 9px;
    background: rgba(0, 45, 98, 0.055);
}

/* =========================
   Buttons
   ========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 24px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease;
}

.full-width {
    width: 100%;
}

.btn-primary {
    color: var(--auth-primary);
    background: var(--auth-accent);
    box-shadow: 0 10px 22px rgba(197, 160, 89, 0.22);
}

.btn-primary:hover {
    background: var(--auth-accent-hover);
    box-shadow: 0 14px 28px rgba(197, 160, 89, 0.3);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* =========================
   Social Login
   ========================= */

.social-login {
    margin-top: 28px;
    text-align: center;
}

.social-login > span {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--auth-text-light);
    font-size: 0.8rem;
}

.social-login > span::before,
.social-login > span::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 12px 20px;
    color: var(--auth-text);
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-white);
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.btn-social i {
    color: #db4437;
    font-size: 1.05rem;
}

.btn-social:hover {
    border-color: #bdc8d5;
    background: #f8fafc;
    transform: translateY(-1px);
}

/* =========================
   Standalone Forms
   ========================= */

.section-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.87rem;
}

.form-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin-bottom: 22px;
    color: var(--auth-primary);
    border: 1px solid rgba(197, 160, 89, 0.45);
    border-radius: 20px;
    background: rgba(197, 160, 89, 0.13);
    font-size: 1.7rem;
}

.secondary-action-button {
    display: block;
    margin: 20px auto 0;
    font-size: 0.87rem;
}

/* =========================
   Laptop and Tablet
   ========================= */

@media (max-width: 980px) {
    .auth-wrapper {
        align-items: start;
        padding: 24px;
    }

    .auth-container {
        grid-template-columns: 1fr;
        width: min(760px, 100%);
        min-height: auto;
    }

    .auth-info {
        padding: 76px 48px 46px;
    }

    .auth-info .logo {
        margin-bottom: 26px;
    }

    .auth-info h1 {
        max-width: 620px;
        font-size: 2.15rem;
    }

    .auth-info > p {
        max-width: 650px;
        margin-bottom: 26px;
    }

    .auth-benefits {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .auth-benefits li {
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.05);
        font-size: 0.83rem;
    }

    .auth-forms {
        padding: 48px;
    }
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 660px) {
    .auth-wrapper {
        display: block;
        min-height: auto;
        padding: 0;
    }

    .auth-container {
        width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-info {
        padding: 70px 24px 34px;
    }

    .back-home {
        top: 22px;
        left: 24px;
    }

    .auth-info .logo {
        margin-bottom: 24px;
    }

    .auth-info .brand-logo {
        height: 42px;
    }

    .auth-info .brand-name {
        font-size: 1.4rem;
    }

    .auth-info h1 {
        font-size: 1.75rem;
    }

    .auth-info > p {
        margin-bottom: 24px;
        font-size: 0.93rem;
    }

    .auth-benefits {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .auth-benefits li {
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 0.88rem;
    }

    .auth-forms {
        align-items: flex-start;
        padding: 38px 24px 46px;
    }

    .tab-label {
        margin-bottom: 28px;
    }

    .name-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .otp-input-group input {
        letter-spacing: 0.32em;
    }
}

/* =========================
   Very Small Screens
   ========================= */

@media (max-width: 380px) {
    .auth-info,
    .auth-forms {
        padding-inline: 18px;
    }

    .back-home {
        left: 18px;
    }

    .auth-info h1 {
        font-size: 1.55rem;
    }

    .tab-label {
        font-size: 0.92rem;
    }
}

/* =========================
   Reduced Motion
   ========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}