/* ════════════════════════════════════════════════════════════════
   Sign in / sign up (accounts/auth/signin.html, signup.html)
   One card: the ship photo beside the form on wide screens, the form
   alone on phones and in the app.
   ════════════════════════════════════════════════════════════════ */

.auth-page {
    padding: 140px 16px 64px;     /* clears the fixed website header */
    background: #f4f7fb;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e6edf5;
    border-radius: 24px;
    box-shadow: 0 24px 60px -28px rgba(8, 58, 95, 0.35);
}

.auth-card--wide {
    max-width: 580px;
}

/* ── Photo panel (wide screens only) ── */
.auth-visual {
    display: none;
    position: relative;
    min-height: 600px;
    background: #0a4570;
}
.auth-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 58, 95, 0) 40%, rgba(8, 58, 95, 0.88) 100%);
}
.auth-visual__text {
    position: absolute;
    left: 36px;
    right: 36px;
    bottom: 36px;
    z-index: 1;
    color: #ffffff;
}
.auth-visual__text h2 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
}
.auth-visual__text p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

@media (min-width: 992px) {
    .auth-card {
        grid-template-columns: minmax(0, 1fr) 460px;
        max-width: 1040px;
    }
    .auth-card--wide {
        grid-template-columns: minmax(0, 1fr) 580px;
        max-width: 1160px;
    }
    .auth-visual {
        display: block;
    }
}

/* ── Form panel ── */
.auth-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 30px;
}

.auth-logo {
    display: inline-flex;
    align-self: flex-start;
}
.auth-logo img {
    height: 44px;
    width: auto;
}

.auth-title {
    margin: 12px 0 4px !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
    color: #0f172a !important;
}

.auth-subtitle {
    margin: 0 0 18px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}

.auth-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}
.auth-alert--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.auth-alert--error,
.auth-alert--danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}
.auth-alert--warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

/* fields */
.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}

.auth-field {
    margin-bottom: 12px;
}

.auth-field label {
    display: block;
    margin: 0 0 5px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #1e293b !important;
}

.auth-input {
    position: relative;
}

.auth-input > .iconify {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input input {
    display: block;
    width: 100% !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 12px 0 42px !important;
    border: 1px solid #dbe4ee !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    font-size: 16px !important;     /* 16px stops iOS zooming in on focus */
    font-weight: 500 !important;
    line-height: normal !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #0f172a !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.auth-input input:focus {
    outline: none !important;
    background: #ffffff !important;
    border-color: #167fca !important;
    box-shadow: 0 0 0 4px rgba(22, 127, 202, 0.12) !important;
}

.auth-input:focus-within > .iconify {
    color: #167fca;
}

/* phone validation (set by the sign-in script) */
.auth-input input.is-valid {
    border-color: #22c55e !important;
}
.auth-input input.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.10) !important;
}

.auth-field .phone-error,
.auth-field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: #dc2626;
}

/* remember me */
.auth-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 2px 0 14px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #475569 !important;
}
.auth-check input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    accent-color: #167fca;
}

/* buttons */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #167fca 0%, #0a4570 100%);
    box-shadow: 0 10px 24px -8px rgba(22, 127, 202, 0.55);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.auth-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 14px 28px -8px rgba(22, 127, 202, 0.6);
}
.auth-submit:active {
    transform: translateY(1px);
}
.auth-submit .iconify {
    width: 20px;
    height: 20px;
}

/* secondary (OTP steps) */
.auth-submit--soft {
    background: #eef6fc;
    box-shadow: none;
    color: #0a4570;
    border: 1px solid #cfe3f3;
}
.auth-submit--soft:hover {
    background: #e2f0fb;
    box-shadow: none;
}
.auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

/* "Don't have a password? …" and similar */
.auth-link-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.5;
    color: #64748b;
    text-align: center;
    cursor: pointer;
}
.auth-link-btn span {
    font-weight: 600;
    color: #167fca;
}
.auth-link-btn:hover span {
    text-decoration: underline;
}

.auth-switch {
    margin: 14px 0 0 !important;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
    text-align: center;
    font-size: 14.5px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}
.auth-switch a {
    font-weight: 600;
    color: #167fca !important;
    text-decoration: none;
}
.auth-switch a:hover {
    text-decoration: underline;
}

/* ── Password / OTP panels (toggled by the sign-in script) ── */
.login-panel {
    max-height: 1000px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.28s ease;
}
.login-panel.is-hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.otp-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f5faff;
}
.otp-header-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #dbeefb;
    color: #167fca;
}
.otp-header-icon .iconify {
    width: 20px;
    height: 20px;
}
.otp-header-text h6 {
    margin: 0 0 2px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #0f172a !important;
}
.otp-header-text p {
    margin: 0 !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    color: #64748b !important;
}

.otp-step {
    margin-bottom: 4px;
}

.otp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.otp-status {
    min-height: 0;
    margin: 8px 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #64748b;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.otp-status.show {
    opacity: 1;
}
.otp-status.success {
    color: #15803d;
}
.otp-status.error {
    color: #dc2626;
}

/* ── Phones ── */
@media (max-width: 575.98px) {
    .auth-page {
        padding: 112px 12px 32px;
    }
    .auth-form {
        padding: 20px 18px;
    }
    .auth-title {
        font-size: 22px !important;
    }
    /* short pairs (first/last name, password/confirm) stay side by side */
    .auth-row:not(.auth-row--pair) {
        grid-template-columns: 1fr;
    }
}

/* ── App: no website header to clear ── */
.is-app .auth-page {
    padding: 12px 12px 20px;
}
.is-app .auth-logo img {
    height: 36px;
}
.is-app .auth-logo {
    align-self: center;
}
.is-app .auth-title,
.is-app .auth-subtitle {
    text-align: center;
}
