/* Auth background */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.page-auth-login {
    background-color: var(--black);
    background-image: url('../img/bruno-mars-2.jpg');
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.page-auth-signup {
    background-color: var(--black);
    background-image: url('../img/bad-bunny.jpg');
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-container {
    display: flex;
    flex-direction: column;
    padding: 4rem 2rem 1rem 2rem;
    /* Use small viewport height to account for mobile browser UI */
    min-height: 100svh;
    box-sizing: border-box;
    justify-content: flex-start;
    gap: 1rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 16px);
}

/* Keep footer at the bottom when space allows; allow scrolling when content is tall */
body.page-auth-signup .auth-footer,
body.page-auth-login .auth-footer {
    margin-top: auto;
}

/* Section wrappers (Required / Optional) */
body.page-auth-signup .auth-section {
    margin-bottom: 1.25rem;
}

body.page-auth-signup .auth-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
    margin: 0 0 0.6rem 0;
}

body.page-auth-signup .auth-section--optional .auth-section-title {
    opacity: 0.75;
}

/* Logo styling */
.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-image {
    max-width: 60px;
    height: auto;
}

/* Greeting section */
.auth-greeting {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--white);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.auth-description {
    font-weight: 300;
    font-size: 1.2rem;
    color: var(--light-gray);
    letter-spacing: -0.2px;
    line-height: 28px;
}

/* Content area */
.auth-content {
    flex: 1;
}

/* Form styling */
.auth-form {
    margin: 0 auto;
    width: 100%;
}

.auth-input {
    display: block;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    padding: 1.2rem 1rem;
    margin-bottom: 1rem;
    color: var(--white);
    font-size: 1.3rem;
}

/* Prevent browser defaults on textarea but keep same look as inputs */
textarea.auth-input {
    -webkit-appearance: none;
    appearance: none;
    resize: none; /* disable manual resizing */
    box-sizing: border-box;
    line-height: 1.4;
    font-family: var(--font-family) !important;
}

/* Row layout helpers */
.auth-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Make first/last name inputs appear side-by-side */
body.page-auth-signup .auth-row--name .auth-input--first-name,
body.page-auth-signup .auth-row--name .auth-input--last-name {
    display: inline-block;
    flex: 1 1 0;
    width: auto;
    min-width: 0; /* allow shrinking to avoid overflow */
    margin-bottom: 1rem;
}

/* Country + Region on the same line */
body.page-auth-signup .auth-row--location .auth-input--country {
    flex: 1 1 0;
    min-width: 0;
}
body.page-auth-signup .auth-row--location .auth-input--region {
    flex: 1.2 1 0; /* region slightly wider */
    min-width: 0;
}

/* Postal Code + Referral on the same line */
body.page-auth-signup .auth-row--postal-referral .auth-input--postal {
    flex: 0.8 1 0; /* postal smaller */
    min-width: 0;
}
body.page-auth-signup .auth-row--postal-referral .auth-input--referral {
    flex: 1.4 1 0; /* referral wider */
    min-width: 0;
}

/* Password row: two inputs on one line */
body.page-auth-signup .auth-row--password .auth-input--password,
body.page-auth-signup .auth-row--password .auth-input--confirm {
    display: inline-block;
    flex: 1 1 0;
    min-width: 0;
}

/* DOB row: DD, MM, YYYY on one line, proportional widths */
body.page-auth-signup .auth-row--dob .auth-input--dob-day {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
}
body.page-auth-signup .auth-row--dob .auth-input--dob-month {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
}
body.page-auth-signup .auth-row--dob .auth-input--dob-year {
    flex: 1.2 1 0; /* slightly wider */
    text-align: center;
    min-width: 0;
}

/* Signup inputs: less rounded corners and visible borders */
body.page-auth-signup .auth-input--signup {
    border-radius: 6px; /* less rounded than default 10px */
    /* Lighter input background and darker text for contrast */
    background-color: var(--light-gray);
    color: #000;
    /* Reduce input height via padding */
    padding: 0.9rem 0.9rem;
    /* Darker border for visibility on light background */
    border: 1px solid rgba(0, 0, 0, 0.4);
}

/* Match textarea with signup inputs on signup page */
body.page-auth-signup .auth-textarea {
    border-radius: 6px;
    background-color: var(--light-gray);
    color: #000;
    padding: 0.9rem 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.4);
}

body.page-auth-signup .auth-input--signup:focus {
    border-color: rgba(0, 0, 0, 0.6);
    background-color: #fff;
}

body.page-auth-signup .auth-textarea:focus {
    border-color: rgba(0, 0, 0, 0.6);
    background-color: #fff;
}

/* Signup placeholders smaller */
body.page-auth-signup .auth-input--signup::placeholder {
    font-size: 1.1rem; /* was 1.3rem */
    color: #000; /* black placeholder on light bg */
}

body.page-auth-signup .auth-textarea::placeholder {
    font-size: 1.1rem;
    color: #000;
}

/* Make last name a bit wider than first name */
body.page-auth-signup .auth-row--name .auth-input--last-name {
    flex: 1.6 1 0; /* grows more than first name */
}

.auth-input::placeholder {
    color: var(--light-gray);
    opacity: 0.7;
    font-size: 1.3rem;
    font-weight: 300;
}

.auth-textarea::placeholder {
    color: var(--light-gray);
    opacity: 0.7;
    font-size: 1.3rem;
    font-weight: 300;
}

.auth-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
}

.auth-textarea:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Form messages */
.form-message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.error {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff6b6b;
}

.form-message.success {
    background-color: rgba(0, 255, 0, 0.1);
    color: #6bff6b;
}

/* Footer with button */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
}

.auth-links {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-link {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 300;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--white);
}

.auth-button {
    background-color: var(--yellow);
    color: var(--black);
    border: none;
    border-radius: 5px;
    padding: 1.5rem 2rem;
    font-weight: 700;
    font-size: 1.3rem;
    cursor: pointer;
    width: 100%;
}

body.page-auth-signup .auth-label--signup {
    display: block;
    color: var(--light-gray);
    font-size: 0.85rem;
    margin: 0.25rem 0 0.4rem;
}