/* ACP Export Logistics — shared auth page branding
   Used by login.php, sign-up.php, forgot-password.php
   ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid #7367f0; outline-offset: 2px; }

body.auth-page {
    min-height: 100vh;
    display: flex;
    font-family: 'Nunito Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
}

/* ── Brand panel ── */
.auth-brand {
    width: 42%;
    min-width: 360px;
    background: linear-gradient(160deg, #4338ca 0%, #5e50ee 55%, #7367f0 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    top: -120px;
    right: -140px;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    bottom: -60px;
    left: -80px;
}

.brand-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; z-index: 1; }
.brand-logo span { opacity: .7; font-weight: 400; }
.brand-logo img { max-height: 48px; filter: brightness(0) invert(1); }

.brand-headline { z-index: 1; }
.brand-headline h2 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.brand-headline p { font-size: 1.05rem; opacity: .82; line-height: 1.7; }

.brand-features { z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.brand-feature { display: flex; align-items: center; gap: 12px; font-size: .95rem; opacity: .88; }
.brand-feature .fi {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand-footer { z-index: 1; font-size: .8rem; opacity: .55; }

/* ── Form panel ── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    overflow-y: auto;
}

.auth-box {
    width: 100%;
    max-width: 460px;
}

.auth-box.wide { max-width: 680px; }

.auth-box .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: .875rem;
    text-decoration: none;
    margin-bottom: 36px;
    transition: color .2s;
}

.auth-box .back-link:hover { color: #5e50ee; }

.auth-box h1 { font-size: 1.75rem; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.auth-box .subtitle { color: #64748b; font-size: .95rem; margin-bottom: 32px; }

.auth-box .form-label {
    font-size: .875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.auth-box .form-label .text-danger { color: #dc2626; }

.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea,
.auth-box .form-control,
.auth-box .select2-container .select2-selection--single {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: .95rem;
    color: #0f172a;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    min-height: 46px;
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus,
.auth-box .form-control:focus,
.auth-box .select2-container--focus .select2-selection--single {
    border-color: #7367f0;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, .12);
}

.input-wrap textarea { resize: vertical; padding-top: 14px; }

.auth-box .iti__tel-input { padding-left: 50px !important; }
.auth-box .select2-container .select2-selection--single .select2-selection__arrow { height: 44px; }

/* Compatibility with existing Bootstrap .form-icon markup */
.auth-box .form-icon { position: relative; }
.auth-box .form-icon .icons,
.auth-box .form-icon .fea,
.auth-box .form-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}
.auth-box .form-icon .form-control.ps-5,
.auth-box .form-control.ps-5 { padding-left: 42px; }

.mb-field { margin-bottom: 18px; }

.row-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: .875rem;
}

.row-extras label { display: flex; align-items: center; gap: 8px; color: #374151; cursor: pointer; }
.row-extras a { color: #7367f0; text-decoration: none; font-weight: 600; }
.row-extras a:hover { text-decoration: underline; }

.btn-auth {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #5e50ee, #7367f0);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    letter-spacing: .3px;
}

.btn-auth:hover { opacity: .92; transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }

.btn-auth-outline {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background .2s, border-color .2s;
}

.btn-auth-outline:hover { background: #e2e8f0; border-color: #cbd5e1; color: #0f172a; }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: .8rem;
    margin: 24px 0;
}

.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

.alt-row { text-align: center; margin-top: 24px; font-size: .875rem; color: #64748b; }
.alt-row a { color: #7367f0; font-weight: 700; text-decoration: none; }
.alt-row a:hover { text-decoration: underline; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    padding: 12px 16px;
    font-size: .875rem;
    margin-bottom: 20px;
}

.alert-warning.auth {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    padding: 14px 16px;
    font-size: .9rem;
    margin-bottom: 20px;
}

/* Demo quick-login */
.demo-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.demo-pill {
    padding: 5px 14px;
    border-radius: 20px;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    color: #5e50ee;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.demo-pill:hover { background: #ddd6fe; }

.form-check-input { accent-color: #7367f0; }
.form-check-label { color: #374151; font-size: .9rem; }
.form-check-label a { color: #7367f0; text-decoration: none; }
.form-check-label a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
    .auth-brand { width: 36%; padding: 36px 28px; min-width: 280px; }
    .brand-headline h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .auth-brand { display: none; }
    body.auth-page { flex-direction: column; }
    .auth-form-panel { padding: 32px 20px; min-height: 100vh; }
}
