:root {
    --primary: #004571;
    --accent: #0ea5e9;
    --grad-start: #0076ff;
    --grad-end: #004571;
    --white: #ffffff;
    --text-high: #0f172a;
    --text-mid: #475569;
    --text-low: #94a3b8;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: #8cb9dc;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/img/x2.jpg') no-repeat center center;
    background-size: cover;
    opacity: 0.52;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.12));
    pointer-events: none;
    z-index: -1;
}

.hidden {
    display: none !important;
}

/* ================= AUTH SPLIT PANEL ================= */
.auth-card {
    background: var(--white);
    width: 1000px;
    height: auto;
    min-height: 620px;
    border-radius: 30px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.6s ease;
}

.auth-side-graphic {
    flex: 1;
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    position: relative;
    padding: 60px;
    color: var(--white);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.graphic-content {
    position: relative;
    z-index: 10;
}

.airplane-icon-wrap {
    margin-bottom: 25px;
}

.graphic-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
}

.graphic-content h3 {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 20px;
}

.graphic-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.7;
    max-width: 320px;
}

.sphere {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
}

.s1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
}

.s2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
}

.s3 {
    width: 220px;
    height: 220px;
    bottom: 100px;
    left: 45%;
}

.auth-side-form {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 60px;
    background: #fff;
}

.full-auth-width {
    flex: unset;
    width: 100%;
}

.form-inner {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

.form-inner-wide {
    max-width: 700px;
}

.reg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 25px;
}

.reg-picture-row {
    margin-bottom: 8px;
    margin-top: 4px;
}

.reg-picture-label {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    gap: 12px;
}

.reg-picture-label:hover {
    border-color: var(--accent);
    background: #f0f9ff;
}

.reg-picture-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    overflow: hidden;
    flex-shrink: 0;
}

.reg-picture-text {
    display: flex;
    flex-direction: column;
}

.reg-picture-action {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.86rem;
}

.reg-picture-hint {
    font-size: 0.74rem;
    color: var(--text-mid);
    margin-top: 1px;
}


.form-header {
    margin-bottom: 20px;
}

.form-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 0.9rem;
    color: var(--text-mid);
}

.field-wrapper {
    background: #f1f3f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 48px;
    margin-bottom: 12px;
    border: 1.5px solid transparent;
    transition: 0.3s;
}

.field-wrapper:focus-within {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.field-wrapper input {
    width: 0;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    height: 100%;
    font-size: 1rem;
    color: var(--text-high);
    font-family: 'Inter', sans-serif;
}

.field-icon {
    margin-right: 12px;
    opacity: 0.4;
    font-size: 1.1rem;
}

.password-toggle {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    letter-spacing: 0.5px;
    user-select: none;
    flex-shrink: 0;
    padding-left: 8px;
}

/* Hide browser native password reveal button */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.form-options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-size: 0.85rem;
}

.checkbox-label {
    color: var(--text-mid);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.btn-primary-auth {
    width: 100%;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Inter', sans-serif;
}

.btn-primary-auth:hover {
    background: #003050;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 69, 113, 0.25);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-mid);
}

/* ================= REGISTER STEP 1 COMPACT STYLING ================= */
#register-step1-section.auth-card {
    min-height: 520px;
    border-radius: 28px;
}

#register-step1-section .auth-side-graphic {
    padding: 40px 50px;
}

#register-step1-section .airplane-icon-wrap {
    margin-bottom: 16px;
}

#register-step1-section .graphic-content h1 {
    font-size: 3rem;
}

#register-step1-section .graphic-content h3 {
    font-size: 1.35rem;
    margin-bottom: 14px;
}

#register-step1-section .graphic-content p {
    font-size: 0.9rem;
    line-height: 1.5;
}

#register-step1-section .auth-side-form {
    padding: 24px 50px;
}

#register-step1-section .form-header {
    margin-bottom: 16px;
}

#register-step1-section .form-header h2 {
    font-size: 1.95rem;
    margin-bottom: 4px;
}

#register-step1-section .form-header p {
    font-size: 0.85rem;
}

#register-step1-section .field-wrapper {
    height: 42px;
    margin-bottom: 10px;
    border-radius: 10px;
    padding: 0 12px;
}

#register-step1-section .field-wrapper input {
    font-size: 0.92rem;
}

#register-step1-section .field-icon {
    margin-right: 10px;
    font-size: 1rem;
}

#register-step1-section .btn-primary-auth {
    height: 44px;
    border-radius: 10px;
    font-size: 0.95rem;
}

#register-step1-section .form-footer {
    margin-top: 16px;
    font-size: 0.88rem;
}

.link-action {
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.error-text {
    color: #e11d48;
    font-size: 0.8rem;
    margin-bottom: 12px;
    display: none;
    text-align: left;
}

.auth-otp-input {
    text-align: center;
    letter-spacing: 0.55em;
    font-weight: 700;
    font-size: 1.8rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

#login-resend-link.disabled {
    pointer-events: none;
    opacity: 0.45;
}

#login-resend-link.ready {
    color: #0ea5e9;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.35);
}

#login-resend-hint {
    margin-top: 8px;
    font-size: 0.85rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= RESPONSIVE — MOBILE ================= */
@media (max-width: 1100px) {
    body {
        align-items: flex-start;
        padding: 18px;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .auth-card {
        width: min(100%, 920px);
        height: auto;
        min-height: 0;
        border-radius: 24px;
    }

    .auth-side-form,
    .full-auth-width {
        padding: 40px 30px;
    }
}

@media (max-width: 900px) {
    .auth-card {
        width: 100%;
        flex-direction: column;
        border-radius: 22px;
    }

    .auth-side-graphic {
        flex: none;
        width: 100%;
        min-height: 190px;
        padding: 28px 22px;
        border-radius: 22px 22px 0 0;
    }

    .graphic-content h1 {
        font-size: 2.15rem;
        letter-spacing: -1px;
    }

    .graphic-content h3 {
        font-size: 1.02rem;
        margin-bottom: 8px;
    }

    .graphic-content p {
        font-size: 0.86rem;
        line-height: 1.45;
        max-width: 100%;
    }

    .airplane-icon-wrap {
        margin-bottom: 12px;
    }

    .airplane-icon-wrap svg {
        width: 44px;
        height: 44px;
    }

    .auth-side-form,
    .full-auth-width {
        width: 100%;
        padding: 26px 20px 24px;
    }

    .form-inner {
        max-width: 100%;
    }

    .form-header {
        margin-bottom: 22px;
    }

    .form-header h2 {
        font-size: 2rem;
        line-height: 1.08;
    }
}

@media (max-width: 768px) {
    .reg-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .auth-card {
        border-radius: 18px;
        box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
    }

    .auth-side-graphic {
        display: flex;
        min-height: 128px;
        padding: 16px 14px;
        border-radius: 18px 18px 0 0;
        align-items: center;
    }

    .airplane-icon-wrap {
        margin-bottom: 8px;
    }

    .airplane-icon-wrap svg {
        width: 30px;
        height: 30px;
    }

    .graphic-content h1 {
        font-size: 1.6rem;
        letter-spacing: -0.5px;
    }

    .graphic-content h3 {
        font-size: 0.86rem;
        margin-bottom: 6px;
    }

    .graphic-content p {
        font-size: 0.75rem;
        line-height: 1.35;
        max-width: 100%;
        opacity: 0.78;
    }

    .auth-side-form,
    .full-auth-width {
        padding: 24px 16px 18px;
    }

    .form-header h2 {
        font-size: 2rem;
    }

    .form-header p {
        font-size: 0.9rem;
    }

    .field-wrapper {
        height: 52px;
        margin-bottom: 12px;
        border-radius: 11px;
        padding: 0 12px;
    }

    .field-wrapper input {
        font-size: 1rem;
    }

    .field-icon {
        margin-right: 8px;
    }

    .form-options {
        margin-bottom: 18px;
        font-size: 0.82rem;
        gap: 8px;
    }

    .btn-primary-auth {
        height: 52px;
        border-radius: 11px;
    }

    .form-footer {
        margin-top: 18px;
        font-size: 0.88rem;
    }
}

@media (max-width: 420px) {
    body {
        padding: 8px;
    }

    .auth-side-form,
    .full-auth-width {
        padding: 22px 14px 16px;
    }

    .form-header h2 {
        font-size: 1.82rem;
    }

    .checkbox-label {
        gap: 6px;
    }
}


/* Utility & helper fixes */
.input-container {
    position: relative;
    width: 100%;
}
.reg-success-icon {
    width: 64px;
    height: 64px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* ================= iOS AUTO-ZOOM PREVENTION ================= */
/* Prevents iOS Safari from zooming in when focusing input fields */
@media (pointer: coarse) {
    .field-wrapper input,
    .field-wrapper select,
    .field-wrapper textarea,
    .auth-otp-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important; /* Minimum to prevent iOS auto-zoom */
    }
}

/* ================= ENHANCED MOBILE AUTH — SMALL PHONES ================= */
@media (max-width: 420px) {
    /* Further minimize graphic panel on very small screens */
    .auth-side-graphic {
        min-height: 90px;
        padding: 12px 14px;
    }

    .graphic-content h1 {
        font-size: 1.35rem;
    }

    .graphic-content h3,
    .graphic-content p {
        display: none; /* Hide secondary text to save space */
    }

    .airplane-icon-wrap img {
        width: 140px !important;
    }

    /* Ensure touch-friendly form elements */
    .field-wrapper {
        height: 52px;
        min-height: 48px;
    }

    .btn-primary-auth {
        height: 52px;
        min-height: 48px;
    }

    /* OTP input sizing for thumbs */
    .auth-otp-input {
        font-size: 1.5rem !important;
        letter-spacing: 0.4em;
    }
}

/* ================= SAFE AREA SUPPORT FOR AUTH PAGES ================= */
@media (max-width: 768px) {
    body {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }
}
