﻿/**
 * =============================================
 *  11 - Auth Form Module (Register / Login / OTP)
 *  Halofinity Platform
 * =============================================
 */

/* ── Page Shell ── */
.auth-page {
    min-height: 100vh;
    background: #cf173c;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 60px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    pointer-events: none;
}

/* ── Logo Bar ── */
.auth-logo-bar {
    width: 100%;
    max-width: 860px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Heading above card ── */
.auth-heading {
    width: 100%;
    max-width: 860px;
    margin-bottom: 28px;
    position: relative;
    z-index: 2;
}

.auth-heading h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.auth-heading p {
    color: rgba(255,255,255,0.72);
    font-size: 15px;
    line-height: 1.6;
}

/* ── Card ── */
.auth-card {
    width: 100%;
    max-width: 860px;
    background: #fff;
    padding: 52px 60px 44px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
    position: relative;
    z-index: 2;
}

/* ── Form Fields ── */
.auth-form {
    display: flex;
    flex-direction: column;
}

/* Two-column grid for desktop */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

/* Full-width override inside grid */
.auth-grid .full { grid-column: 1 / -1; }

.auth-field {
    position: relative;
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.auth-field .field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field .field-icon {
    position: absolute;
    left: 14px;
    color: #ccc;
    font-size: 17px;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="tel"] {
    width: 100%;
    padding: 13px 14px 13px 42px;
    border: 1.5px solid #e2e2e2;
    border-radius: 0;
    font-size: 15px;
    color: #1a1a2e;
    font-family: 'Manrope', sans-serif;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.auth-field input:focus {
    border-color: #cf173c;
    background: #fff;
    box-shadow: none;
}

.auth-field .field-wrap:focus-within .field-icon {
    color: #cf173c;
}

/* ── Validation states ── */
.auth-field input.is-valid   { border-color: #27ae60; background: #fff; }
.auth-field input.is-invalid { border-color: #cf173c; background: #fff; }

.auth-field .field-feedback {
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.auth-field .field-feedback.valid   { color: #27ae60; }
.auth-field .field-feedback.invalid { color: #cf173c; }

/* ── Toggle password visibility ── */
.toggle-pw {
    position: absolute;
    right: 13px;
    cursor: pointer;
    color: #bbb;
    font-size: 17px;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
    z-index: 3;
}
.toggle-pw:hover { color: #cf173c; }

/* ── intl-tel-input overrides ── */
.iti { width: 100%; }
.iti__country-container button,
.iti__selected-country { border-radius: 0 !important; }
#phone { padding-left: 58px !important; }

/* ── Submit button ── */
.auth-submit {
    width: 100%;
    padding: 16px;
    background: #cf173c;
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    letter-spacing: 0.3px;
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.auth-submit:hover   { background: #a81030; box-shadow: 0 6px 24px rgba(207,23,60,0.30); }
.auth-submit:active  { background: #8f0d27; }
.auth-submit:disabled { background: #e8a0a8; cursor: not-allowed; box-shadow: none; }

.auth-submit .spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}
.auth-submit.loading .spinner  { display: block; }
.auth-submit.loading .btn-text { opacity: 0.6; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
.auth-divider {
    text-align: center;
    font-size: 13px;
    color: #bbb;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.auth-divider a { color: #cf173c; font-weight: 700; text-decoration: none; }
.auth-divider a:hover { text-decoration: underline; }

/* ── Alert banner  — NO left border ── */
.auth-alert {
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.auth-alert.error   { background: #fff0f3; color: #cf173c; }
.auth-alert.success { background: #f0fff4; color: #27ae60; }

/* ── Password strength bar ── */
.strength-bar {
    height: 3px;
    background: #eee;
    margin-top: 6px;
    overflow: hidden;
}
.strength-bar__fill {
    height: 100%;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .auth-card { padding: 36px 28px 32px; }
    .auth-grid { grid-template-columns: 1fr; gap: 0; }
    .auth-heading h1 { font-size: 28px; }
    .auth-logo-bar { max-width: 100%; }
    .auth-heading  { max-width: 100%; }
    .auth-card     { max-width: 100%; }
}

@media (max-width: 480px) {
    .auth-page { padding: 28px 14px 48px; }
    .auth-card { padding: 28px 18px 26px; }
    .auth-heading h1 { font-size: 24px; }
}

/* ── Wizard Progress Bar ── */
.auth-wizard-bar {
    width: 100%;
    max-width: 860px;
    margin-bottom: 36px;
    position: relative;
    z-index: 2;
}

.auth-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wiz-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wiz-step__circle {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.wiz-step__label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.3s;
}

/* Active step */
.wiz-step.active .wiz-step__circle {
    background: #fff;
    border-color: #fff;
    color: #cf173c;
}
.wiz-step.active .wiz-step__label {
    color: #fff;
}

/* Completed step */
.wiz-step.done .wiz-step__circle {
    background: rgba(255,255,255,0.30);
    border-color: rgba(255,255,255,0.55);
    color: #fff;
}
.wiz-step.done .wiz-step__label {
    color: rgba(255,255,255,0.75);
}

/* Connector line */
.wiz-step__line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.2);
    margin-bottom: 22px; /* aligns with circle middle */
    min-width: 20px;
}

/* ── Wizard responsive ── */
@media (max-width: 768px) {
    .auth-wizard-bar { max-width: 100%; margin-bottom: 28px; }

    .wiz-step__circle { width: 36px; height: 36px; font-size: 15px; }
    .wiz-step__label  { font-size: 10px; }
    .wiz-step__line   { min-width: 10px; }
}

@media (max-width: 480px) {
    /* On very small screens hide labels, keep circles */
    .wiz-step__label { display: none; }
    .wiz-step__circle { width: 32px; height: 32px; font-size: 13px; }
    .wiz-step__line { margin-bottom: 0; }
    .wiz-step { gap: 0; }
}
