/* ══════════════════════════════════════════════
   AQUAFLOW — SITE CSS (LOGIN + REGISTER) — FULLY RESPONSIVE
   Breakpoints: 1024 | 900 | 768 | 600 | 480 | 360
   ══════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ink: #03070f;
    --deep: #060d1a;
    --card: #0b1628;
    --panel: #0f1e35;
    --blue: #0ea5e9;
    --cyan: #22d3ee;
    --green: #4ade80;
    --gold: #f59e0b;
    --red: #f87171;
    --white: #f0f6ff;
    --muted: #64748b;
    --border: rgba(14, 165, 233, 0.18);
    --r: 14px;
}

html, body {
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
    background: var(--ink);
    color: var(--white);
    overflow-x: hidden;
}

    /* ── BACKGROUNDS ── */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background: radial-gradient(ellipse 700px 500px at 15% 20%, rgba(14,165,233,0.07), transparent), radial-gradient(ellipse 500px 400px at 85% 80%, rgba(34,211,238,0.05), transparent);
        pointer-events: none;
    }

    body::after {
        content: '';
        position: fixed;
        inset: 0;
        background-image: linear-gradient(rgba(14,165,233,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(14,165,233,0.03) 1px, transparent 1px);
        background-size: 56px 56px;
        pointer-events: none;
        mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
    }

/* ══════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════ */
.page-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 400px 1fr;
}

/* ══════════════════════════════════════════════
   LEFT PANEL
   ══════════════════════════════════════════════ */
.left-panel {
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

    .left-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(160deg, rgba(14,165,233,0.06), transparent 50%);
        pointer-events: none;
    }

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 52px;
    position: relative;
    z-index: 1;
}

.brand-dot {
    width: 10px;
    height: 10px;
    background: var(--cyan);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%,100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

.brand-name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--white);
}

    .brand-name span {
        color: var(--blue);
    }

.left-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.8px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.left-sub {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 44px;
    position: relative;
    z-index: 1;
}

/* Step progress */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 1;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 28px;
    position: relative;
}

    .step-item:not(:last-child)::after {
        content: '';
        position: absolute;
        left: 15px;
        top: 32px;
        width: 1px;
        height: calc(100% - 12px);
        background: var(--border);
        transition: background 0.4s;
    }

    .step-item.done:not(:last-child)::after {
        background: var(--blue);
    }

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--muted);
    background: var(--card);
    transition: all 0.4s;
    position: relative;
    z-index: 1;
}

.step-item.active .step-num {
    border-color: var(--blue);
    background: rgba(14,165,233,0.15);
    color: var(--blue);
    box-shadow: 0 0 20px rgba(14,165,233,0.3);
}

.step-item.done .step-num {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.step-info {
    padding-top: 4px;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.3s;
}

.step-item.active .step-label,
.step-item.done .step-label {
    color: var(--white);
}

.step-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.5;
}

/* Benefits */
.benefits {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
}

    .benefit-item::before {
        content: '✓';
        color: var(--green);
        font-weight: 700;
    }

/* ══════════════════════════════════════════════
   MOBILE BRAND BAR (replaces left panel on mobile)
   ══════════════════════════════════════════════ */
.mobile-brand-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

    .mobile-brand-bar .brand {
        margin-bottom: 0;
    }

    .mobile-brand-bar .brand-name {
        font-size: 18px;
    }

.mobile-back-link {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

    .mobile-back-link:hover {
        color: var(--blue);
    }

/* ══════════════════════════════════════════════
   RIGHT PANEL — FORM
   ══════════════════════════════════════════════ */
.right-panel {
    padding: 48px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    min-height: 100vh;
}

.form-wrap {
    width: 100%;
    max-width: 640px;
    animation: slide-in 0.5s ease both;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Top bar */
.form-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}

.top-login-link {
    font-size: 14px;
    color: var(--muted);
}

    .top-login-link a {
        color: var(--blue);
        font-weight: 600;
        text-decoration: none;
        transition: color 0.2s;
    }

        .top-login-link a:hover {
            color: var(--cyan);
        }

/* Progress bar */
.progress-bar-wrap {
    width: 100%;
    max-width: 640px;
    margin-bottom: 40px;
}

.progress-track {
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

/* Step blocks */
.step-block {
    display: none;
}

    .step-block.active {
        display: block;
        animation: fade-step 0.4s ease both;
    }

@keyframes fade-step {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-block-back {
    animation-name: fade-step-back;
}

@keyframes fade-step-back {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step header */
.step-header {
    margin-bottom: 32px;
}

.step-tag {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.step-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.step-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════
   FIELD GRIDS
   ══════════════════════════════════════════════ */
.field-grid {
    display: grid;
    gap: 18px;
}

.field-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.field-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ══════════════════════════════════════════════
   FIELD
   ══════════════════════════════════════════════ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(240,246,255,0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.field-required {
    color: var(--red);
}

.field-optional {
    font-size: 10px;
    color: var(--muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 400;
}

.field-input {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    width: 100%;
    min-height: 48px; /* better touch target */
    -webkit-appearance: none;
    appearance: none;
}

    .field-input:focus {
        border-color: var(--blue);
        background: rgba(14,165,233,0.04);
        box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
    }

    .field-input::placeholder {
        color: var(--muted);
    }

    .field-input.error {
        border-color: var(--red);
        box-shadow: 0 0 0 3px rgba(248,113,113,0.12);
    }

    .field-input.success {
        border-color: var(--green);
    }

/* Select */
select.field-input {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--panel);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b8098' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    color: var(--white);
    cursor: pointer;
}

    select.field-input option {
        background-color: #0b1628;
        color: #fff;
    }

/* Password wrapper */
.pw-wrap {
    position: relative;
}

    .pw-wrap .field-input {
        padding-right: 52px;
    }

.pw-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    transition: color 0.2s;
    line-height: 1;
}

    .pw-toggle:hover {
        color: var(--blue);
    }

/* Password strength */
.pw-strength {
    margin-top: 8px;
}

.pw-strength-bar {
    height: 3px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

.pw-strength-text {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

.field-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.field-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 2px;
    display: none;
}

    .field-error.show {
        display: block;
    }

/* Section divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
}

.section-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-divider-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════
   ALERT BOX
   ══════════════════════════════════════════════ */
.alert-box {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    display: none;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
}

    .alert-box.show {
        display: flex;
    }

    .alert-box.error {
        background: rgba(248,113,113,0.08);
        border: 1px solid rgba(248,113,113,0.25);
        color: var(--red);
    }

    .alert-box.success {
        background: rgba(74,222,128,0.08);
        border: 1px solid rgba(74,222,128,0.25);
        color: var(--green);
    }

.alert-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px; /* touch-friendly */
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    flex: 1;
    justify-content: center;
}

    .btn-primary:hover:not(:disabled) {
        background: #0284c7;
        transform: translateY(-1px);
        box-shadow: 0 8px 24px rgba(14,165,233,0.35);
    }

    .btn-primary:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.btn-back {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--white);
    min-width: 100px;
}

    .btn-back:hover {
        background: rgba(255,255,255,0.08);
    }

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn-primary.loading .spinner {
    display: block;
}

.btn-primary.loading .btn-label {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════════════
   SUCCESS SCREEN
   ══════════════════════════════════════════════ */
.success-screen {
    text-align: center;
    padding: 40px 0;
    animation: scale-in 0.5s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(74,222,128,0.1);
    border: 2px solid rgba(74,222,128,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 28px;
    animation: glow-green 2s ease-in-out infinite;
}

@keyframes glow-green {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(74,222,128,0.3);
    }

    50% {
        box-shadow: 0 0 30px 8px rgba(74,222,128,0.15);
    }
}

.success-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.success-sub {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 32px;
}

.success-info-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 0 auto 32px;
    max-width: 380px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 4px;
}

.info-label {
    color: var(--muted);
}

.info-val {
    font-weight: 600;
    color: var(--white);
    word-break: break-all;
}

    .info-val.blue {
        color: var(--blue);
    }

.countdown-text {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
}

.countdown-num {
    color: var(--blue);
    font-weight: 700;
}

/* ══════════════════════════════════════════════
   AUTOFILL OVERRIDES
   ══════════════════════════════════════════════ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f1e35 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 1024px
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .page-wrap {
        grid-template-columns: 340px 1fr;
    }

    .left-panel {
        padding: 36px 28px;
    }

    .right-panel {
        padding: 40px 40px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 900px
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
    .page-wrap {
        grid-template-columns: 1fr;
    }

    .left-panel {
        display: none;
    }

    .mobile-brand-bar {
        display: flex;
    }

    .right-panel {
        padding: 24px 32px;
        min-height: calc(100vh - 64px);
    }

    .form-topbar {
        margin-bottom: 24px;
    }

    .progress-bar-wrap {
        margin-bottom: 28px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 768px
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .field-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .field-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .right-panel {
        padding: 24px 24px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 600px
   ══════════════════════════════════════════════ */
@media (max-width: 600px) {
    .right-panel {
        padding: 20px 16px;
    }

    .field-grid-2, .field-grid-3 {
        grid-template-columns: 1fr;
    }

    .btn-row {
        flex-direction: column-reverse;
    }

        .btn-row .btn {
            width: 100%;
            justify-content: center;
        }

    .btn-back {
        flex: none;
    }

    .form-topbar {
        margin-bottom: 20px;
    }

    .step-header {
        margin-bottom: 24px;
    }

    .success-info-box {
        padding: 16px;
    }

    .info-row {
        font-size: 13px;
    }

    .success-screen {
        padding: 24px 0;
    }

    .success-icon {
        width: 68px;
        height: 68px;
        font-size: 28px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 480px
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .right-panel {
        padding: 16px 12px;
    }

    .mobile-brand-bar {
        padding: 14px 16px;
    }

        .mobile-brand-bar .brand-name {
            font-size: 16px;
        }

    .field-input {
        padding: 12px 14px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .btn {
        padding: 13px 20px;
        font-size: 14px;
        min-height: 50px;
    }

    .step-title {
        font-size: 22px;
    }

    .step-tag {
        font-size: 11px;
    }

    .section-divider {
        margin: 4px 0 16px;
    }

    .section-divider-label {
        font-size: 10px;
    }

    .success-info-box {
        max-width: 100%;
    }

    .pw-toggle {
        right: 10px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — 360px
   ══════════════════════════════════════════════ */
@media (max-width: 360px) {
    .right-panel {
        padding: 12px 10px;
    }

    .field-input {
        font-size: 16px;
        padding: 11px 12px;
    }

    .field-label {
        font-size: 12px;
    }

    .field-hint, .field-error {
        font-size: 11px;
    }

    .step-title {
        font-size: 20px;
        letter-spacing: -0.3px;
    }

    .btn {
        font-size: 13px;
        padding: 12px 16px;
    }

    .progress-label {
        font-size: 11px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .success-title {
        font-size: 22px;
    }

    .success-sub {
        font-size: 13px;
    }

    .info-row {
        font-size: 12px;
    }
}

/* ══════════════════════════════════════════════
   LOGIN PAGE SPECIFIC
   ══════════════════════════════════════════════ */
.login-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

/* ══════════════════════════════════════════════
   TOUCH REFINEMENTS
   ══════════════════════════════════════════════ */
@media (hover: none) {
    .btn-primary:hover:not(:disabled) {
        transform: none;
    }

    .btn-back:hover {
        transform: none;
    }
}

/* ══════════════════════════════════════════════
   REGISTER SPECIFIC - checkbox row
   ══════════════════════════════════════════════ */
.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.terms-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--blue);
    cursor: pointer;
}

.terms-label {
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1.5;
}

    .terms-label a {
        color: var(--blue);
        text-decoration: none;
    }

        .terms-label a:hover {
            text-decoration: underline;
        }

@media (max-width: 480px) {
    .terms-label {
        font-size: 12px;
    }
}
