/* ============================================================
   Variables
   ============================================================ */
:root {
    --primary: #860052;
    --primary-dark: #540033;
    --primary-darker: #250017;
    --btn: #b04b82;
    --text: #1f1f24;
    --bg: #fff6fa;
    --white: #ffffff;

    --font-heading: "Barlow", sans-serif;
    --font-body: "Source Sans 3", sans-serif;
}

/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-width: 320px;
    overflow-x: hidden;
}

/* ============================================================
   Page wrapper
   ============================================================ */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page > .site-footer-stack {
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

.page > .site-footer-stack .disclaimer,
.page > .site-footer-stack .footer {
    flex-shrink: 0;
}

.page sup {
    font-size: var(--sup-size, 0.58em) !important;
    position: relative;
    top: calc(-1 * var(--sup-offset, 0.55em)) !important;
    vertical-align: baseline !important;
    line-height: 0;
}

.disclaimer .site-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: clamp(16px, 4vw, 80px);
    padding-right: clamp(16px, 4vw, 80px);
}

/* ============================================================
   Hero section
   ============================================================ */
.hero {
    position: relative;
    background: url("../images/bg-hero.png") left top / cover no-repeat
        var(--bg);
    min-height: 826px;
}

/* Bottom fade: image transitions to page background colour */
.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 249px;
    background: linear-gradient(
        to bottom,
        rgba(255, 246, 250, 0) 0%,
        rgba(255, 246, 250, 1) 54%
    );
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    padding: 109px 80px 80px 0;
    min-height: 826px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

/* ============================================================
   Header logo circle (half-cut at top-left)
   ============================================================ */
.logo-circle {
    position: absolute;
    top: -150px;
    left: 0;
    width: 300px;
    height: 300px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.logo-circle img {
    width: 207px;
    max-height: 80px;
    object-fit: contain;
    transform: translateY(55px);
}

/* ============================================================
   Login card
   ============================================================ */
.login-card {
    width: 411px;
    background: var(--white);
    padding: 40px 30px 38px;
    flex-shrink: 0;
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(37, 0, 23, 0.12);
}

.login-card__title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 28px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 30px;
}

.login-card__subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 30px;
}

.login-card--reset {
    min-height: 289px;
    padding-top: 34px;
    padding-bottom: 36px;
}

.login-card__title--reset {
    max-width: 193px;
    line-height: 1.15;
    margin: 0 auto 46px;
}

.login-card--reset-password {
    min-height: auto;
}

.login-card__title--reset-password {
    max-width: 240px;
    margin-bottom: 18px;
}

.login-card__subtitle--reset-password {
    text-align: center;
    margin-bottom: 26px;
}

/* ============================================================
   Alert – validation errors
   ============================================================ */
.alert-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    color: #b91c1c;
    margin-bottom: 16px;
    line-height: 1.4;
}

.alert-error ul {
    padding-left: 16px;
    margin: 4px 0 0;
}

.alert-success {
    background: #f8ecf3;
    border: 1px solid #d69dbc;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--primary-dark);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ============================================================
   Form fields
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group--reset {
    margin-bottom: 30px;
}

.form-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 9px;
}

.form-helper {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.4;
    color: #7c4563;
}

.form-helper.is-valid {
    color: var(--primary);
}

.form-helper.is-error {
    color: #b91c1c;
}

.form-options {
    margin-bottom: 18px;
}

.form-input {
    display: block;
    width: 100%;
    height: 34px;
    background: #fff6fa;
    border: 0;
    border-bottom: 1px solid #c98aac;
    border-radius: 0;
    outline: none;
    padding: 0 2px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #fff6fa inset;
    box-shadow: 0 0 0 1000px #fff6fa inset;
}

.form-input:focus {
    border-bottom-color: var(--primary);
}

.form-input-wrap {
    position: relative;
}

.form-input--password {
    padding-right: 40px;
}

.form-input--password.is-masked {
    -webkit-text-security: disc;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #7c4563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(134, 0, 82, 0.35);
    outline-offset: 1px;
}

.password-toggle-icon {
    width: 20px;
    height: auto;
    display: block;
}

.password-toggle-icon--hide {
    display: none;
}

.password-toggle.is-active .password-toggle-icon--show {
    display: none;
}

.password-toggle.is-active .password-toggle-icon--hide {
    display: block;
}

/* ============================================================
   Checkboxes
   ============================================================ */
.form-checkboxes {
    margin-bottom: 28px;
}

.form-checkbox--remember {
    grid-template-columns: 14px minmax(0, 1fr);
    column-gap: 12px;
    margin-bottom: 0;
}

.form-checkbox--remember input[type="checkbox"] {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    margin-top: 1px;
}

.form-checkbox--remember input[type="checkbox"]:checked::after {
    top: 1px;
    left: 4px;
}

.form-checkbox--remember span {
    font-size: 13px;
    line-height: 1.35;
    color: var(--primary-dark);
}

.form-checkbox {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    margin-top: 2px;
    border: 1px solid var(--text);
    background: var(--white);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.form-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 3px;
    width: 4px;
    height: 7px;
    border: 2px solid var(--white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.form-checkbox span {
    display: block;
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--text);
    line-height: 1.4;
}

.form-checkbox a {
    color: var(--text);
    text-decoration: underline;
}

.form-checkbox a:hover {
    color: var(--primary);
}

.login-card__subtitle a {
    color: var(--text);
    text-decoration: underline;
}

.login-card__subtitle a:hover {
    color: var(--primary);
}

.form-helper a {
    color: var(--text);
    text-decoration: underline;
}

.form-helper a:hover {
    color: var(--primary);
}

/* ============================================================
   Form actions: button + forgot link (same row)
   ============================================================ */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-actions--reset {
    justify-content: center;
}

.form-actions--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 34px;
    padding: 0 16px;
    background: var(--btn);
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--white);
    white-space: nowrap;
    transition: background 0.15s ease;
    border-radius: 8px;
}

.btn-submit:hover {
    background: var(--primary);
}

.btn-submit svg {
    width: 6px;
    height: 10px;
    flex-shrink: 0;
}

.btn-submit--link {
    justify-content: center;
    text-decoration: none;
}

.btn-submit--compact {
    align-self: flex-start;
    justify-content: center;
    min-width: 176px;
    padding: 0 18px;
}

.password-rules {
    margin-bottom: 24px;
}

.password-rules__title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.password-rules__list {
    list-style: none !important;
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    margin-left: 0;
}

.password-rule {
    position: relative;
    min-height: 18px;
    padding-left: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #5f4a56;
    list-style: none !important;
}

.password-rule.is-valid {
    color: #1f8f43;
    font-weight: 600;
}

.link-forgot {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 12px;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* ============================================================
   Disclaimer strip
   ============================================================ */
.disclaimer {
    position: relative;
    z-index: 1;
    background: var(--bg);
}

.disclaimer.py-4 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.disclaimer-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

@media (min-width: 768px) {
    .disclaimer-row {
        align-items: center;
    }
}

.disclaimer-icon {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.disclaimer-icon-svg {
    width: 42px;
    height: 42px;
    display: block;
}

.disclaimer-icon-svg rect {
    transform-box: fill-box;
    transform-origin: center;
    will-change: transform;
}

.disclaimer-icon-svg rect:first-child {
    animation: disclaimerLightOrbit 1.8s ease-in-out infinite;
}

.disclaimer-icon-svg rect:last-child {
    animation: disclaimerDarkOrbit 1.8s ease-in-out infinite;
}

@keyframes disclaimerDarkOrbit {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    24% {
        transform: translate(9px, -11px) scale(0.94);
    }
    50% {
        transform: translate(18px, -22px) scale(0.83);
    }
    74% {
        transform: translate(9px, -11px) scale(0.94);
    }
}

@keyframes disclaimerLightOrbit {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    24% {
        transform: translate(-9px, 11px) scale(1.1);
    }
    50% {
        transform: translate(-18px, 22px) scale(1.22);
    }
    74% {
        transform: translate(-9px, 11px) scale(1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .disclaimer-icon-svg rect {
        animation: none !important;
    }
}

.disclaimer-text {
    flex: 1;
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    color: var(--text);
    line-height: 1.45;
}

.disclaimer-text p {
    margin: 0;
}

.disclaimer-logo-empataz {
    height: clamp(38px, 3.2vw, 52px);
    width: auto;
    max-width: 190px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    --footer-vpad: 20px;
    background: linear-gradient(to right, #540033 0%, #250017 100%);
    padding: var(--footer-vpad) 80px;
    min-height: 137px;
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    align-items: stretch;
    gap: 0 20px;
}

.footer-main {
    padding: 16px 32px;
}

.footer-main--brand {
    padding-left: 0;
}

.footer-main--brand,
.footer-main--info,
.footer-main--contact {
    display: grid;
    grid-template-rows: 37px auto;
}

.footer-main--info,
.footer-main--contact {
    position: relative;
}

.footer-main--info::before,
.footer-main--contact::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--footer-vpad) * -1);
    bottom: calc(var(--footer-vpad) * -1);
    width: 1px;
    background: rgba(255, 255, 255, 0.18);
}

.footer-main--contact {
    padding-right: 0;
}

.footer-logo {
    height: 37px;
    object-fit: contain;
    display: block;
    align-self: end;
    margin-bottom: 0;
}

.footer-address {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 12px;
    color: var(--white);
    line-height: 1.7;
}

.footer-address + .footer-address {
    margin-top: 6px;
}

.footer-col__title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
    margin-bottom: 0;
    display: block;
    align-self: end;
}

.footer-main--brand .footer-address:first-of-type,
.footer-main--info .footer-links,
.footer-main--contact .footer-links {
    margin-top: 12px;
}

.footer-links {
    display: grid;
    gap: 8px 22px;
}

.footer-links--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer-links--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-links-col {
    min-width: 0;
}

.footer-links-col a {
    display: block;
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 12px;
    color: var(--white);
    text-decoration: none;
    margin-bottom: 7px;
    line-height: 1.4;
}

.footer-links-col a:last-child {
    margin-bottom: 0;
}

.footer-links-col a:hover {
    text-decoration: underline;
}

/* ============================================================
   Responsive – Tablet (≤ 1280px)
   ============================================================ */
@media (max-width: 1280px) {
    .footer {
        padding: var(--footer-vpad) 48px;
    }

    .footer-main {
        padding: 14px 18px;
    }

    .footer-links--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================================
   Responsive – Tablet (≤ 1100px)
   ============================================================ */
@media (max-width: 1100px) {
    .hero-inner {
        padding: 80px 40px 80px;
        justify-content: center;
    }

    .login-card {
        width: 100%;
        max-width: 460px;
    }

    .logo-circle {
        width: 220px;
        height: 220px;
        top: -110px;
    }

    .logo-circle img {
        width: 150px;
        transform: translateY(40px);
    }

    .footer {
        padding: var(--footer-vpad) 40px;
    }

    .footer-inner {
        grid-template-columns: 1.2fr 0.95fr 0.85fr;
    }

    .footer-main {
        padding: 12px 12px;
    }

    .footer-links--3,
    .footer-links--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .disclaimer-row {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon text"
            "logo logo";
        column-gap: 14px;
        row-gap: 10px;
        align-items: start;
    }

    .disclaimer-icon {
        grid-area: icon;
        align-self: start;
    }

    .disclaimer-text {
        grid-area: text;
    }

    .disclaimer-logo-empataz {
        grid-area: logo;
        justify-self: end;
        margin-left: 0;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .footer-main {
        padding: 0;
    }

    .footer-main--info,
    .footer-main--contact {
        position: static;
    }

    .footer-main--info::before,
    .footer-main--contact::before {
        display: none;
    }
}

/* ============================================================
   Responsive – Mobile (≤ 767px)
   ============================================================ */
@media (max-width: 767px) {
    .hero {
        min-height: auto;
    }

    .hero-inner {
        padding: 90px 20px 40px;
        min-height: auto;
        justify-content: center;
    }

    .logo-circle {
        width: 160px;
        height: 160px;
        top: -80px;
        left: 50%;
        transform: translateX(-50%);
    }

    .logo-circle img {
        width: 120px;
        transform: translateY(30px);
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        padding: 32px 20px 28px;
    }

    .login-card--reset {
        min-height: auto;
        padding-top: 30px;
    }

    .login-card__title--reset {
        margin-bottom: 34px;
    }

    .disclaimer.py-4 {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .disclaimer-row {
        column-gap: 10px;
        row-gap: 8px;
    }

    .disclaimer-text {
        font-size: 12px;
        line-height: 1.55;
    }

    .disclaimer-logo-empataz {
        height: 34px;
        justify-self: end;
        margin-left: 0;
    }

    .footer {
        padding: 24px 20px;
    }

    .footer-inner {
        display: grid;
        gap: 12px;
    }

    .footer-main {
        padding: 0;
    }

    .footer-links--3,
    .footer-links--2 {
        grid-template-columns: 1fr;
        gap: 4px 0;
    }
}

/* ============================================================
   Auth-required notice
   ============================================================ */
.auth-required-notice {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: min(460px, calc(100vw - 32px));
    background: var(--white);
    border: 1px solid rgba(134, 0, 82, 0.25);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(37, 0, 23, 0.18);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: start;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
    pointer-events: none;
}

.auth-required-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-required-notice[hidden] {
    display: none !important;
}

.auth-required-notice__icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-required-notice__icon .disclaimer-icon-svg {
    width: 32px;
    height: 32px;
}

.auth-required-notice__content strong {
    display: block;
    margin: 0 0 2px;
    font-family: var(--font-heading);
    font-size: 15px;
    line-height: 1.2;
    color: var(--primary);
}

.auth-required-notice__content p {
    margin: 0;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.35;
    color: var(--text);
}

.auth-required-notice__close {
    border: 0;
    background: transparent;
    color: var(--primary);
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-required-notice__close:hover {
    background: rgba(134, 0, 82, 0.1);
}

@media (max-width: 767px) {
    .auth-required-notice {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
    }
}
