/**
 * Corporate login — desktop split layout + mobile-first responsive
 */

.corp-login-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #12090b;
}

.corp-login-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

/* ─── Brand panel (left) ─────────────────────────────────── */
.corp-login-aside {
    flex: 0 0 38%;
    max-width: 500px;
    background: linear-gradient(165deg, #201014 0%, #3a151d 45%, #1a0d12 100%);
    color: #f8e6c8;
    display: flex;
    flex-direction: column;
    padding: 1.7rem 2rem;
    position: relative;
    overflow: hidden;
}

.corp-login-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 0% 30%, rgba(255,215,0,.18), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 80%, rgba(217,119,6,.2), transparent 50%);
    pointer-events: none;
}

.corp-login-aside::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e8c547, #c9a227, #a67c00);
}

.corp-login-back {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: rgba(253, 230, 138, .86);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    transition: color .15s;
}
.corp-login-back:hover { color: #facc15; }

.corp-login-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.corp-login-topbar .theme-toggle {
    flex-shrink: 0;
    background: rgba(253, 230, 138, 0.12);
    border-color: rgba(253, 230, 138, 0.28);
    color: #fde68a;
}
.corp-login-topbar .theme-toggle:hover {
    background: rgba(253, 230, 138, 0.24);
    color: #fef3c7;
}

.corp-aside-inner {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.corp-brand-lockup {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.corp-brand-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.35);
}

.corp-brand-lockup h1 {
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
    margin: 0 0 .4rem;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: #fff7df;
}

.corp-tagline {
    margin: 0;
    font-size: .88rem;
    color: rgba(255, 236, 179, .78);
    line-height: 1.5;
}

.corp-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: grid;
    gap: .65rem;
}

.corp-feature-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .86rem;
    font-weight: 500;
    color: rgba(255, 236, 179, .9);
    padding: .75rem 1rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(253, 230, 138, .22);
    border-radius: 12px;
}

.corp-feature-list li i {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: .95rem;
    background: rgba(253,230,138,.12) !important;
    color: #fbbf24 !important;
}

.corp-aside-meta {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    font-size: .78rem;
    color: rgba(255, 236, 179, .7);
}
.corp-aside-meta span { display: flex; align-items: center; gap: .45rem; }
.corp-aside-meta i { color: #fbbf24; }

/* ─── Sign-in panel (right) ──────────────────────────────── */
.corp-login-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-width: 0;
    background:
        radial-gradient(ellipse 45% 40% at 70% 45%, rgba(251, 191, 36, .10), transparent 65%),
        radial-gradient(ellipse 35% 30% at 40% 75%, rgba(217, 119, 6, .12), transparent 70%),
        #1a0d12;
}

.corp-login-card {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(170deg, #fffefb 0%, #fff7e8 100%);
    border-radius: 22px;
    padding: 2rem 1.85rem;
    box-shadow: 0 22px 46px rgba(0,0,0,.35), 0 0 0 1px rgba(217,119,6,.14);
    border-top: 4px solid #d97706;
}

.corp-login-card-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.corp-login-badge {
    width: 48px;
    height: 48px;
    margin: 0 auto .85rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid rgba(217,119,6,.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #b45309;
}

.corp-login-card-head h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3b1f0d;
    margin: 0 0 .25rem;
    letter-spacing: -.02em;
}

.corp-login-card-head p {
    margin: 0;
    font-size: .84rem;
    color: #7c5a3b;
}

.corp-alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .75rem 1rem;
    border-radius: 12px;
    font-size: .84rem;
    margin-bottom: 1.25rem;
}
.corp-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.corp-field-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #7c5a3b;
    margin-bottom: .55rem;
}

/* Role list — compact corporate rows */
.corp-role-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}

.corp-role-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .7rem .85rem;
    border: 1.5px solid #f1dcc0;
    border-radius: 12px;
    background: #fffdfa;
    cursor: pointer;
    text-align: left;
    transition: all .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.corp-role-item:hover {
    border-color: #f5c56c;
    background: #fff;
    box-shadow: 0 6px 14px rgba(146, 64, 14, .10);
}

.corp-role-item.active {
    box-shadow: 0 4px 16px rgba(15,23,42,.08);
}

.cri-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.cri-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.cri-text strong {
    font-size: .82rem;
    font-weight: 700;
    color: #3b1f0d;
    line-height: 1.2;
}

.cri-text small {
    font-size: .68rem;
    color: #9a7a58;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cri-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    font-size: .85rem;
    transition: transform .18s, color .18s;
}

.corp-role-item.active .cri-arrow {
    color: inherit;
    transform: translateX(2px);
}

/* Role colors */
.cri-owner { border-color: #fde68a; }
.cri-owner .cri-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.cri-owner.active { border-color: #f59e0b; background: #fffbeb; }
.cri-owner.active .cri-arrow { color: #d97706; }

.cri-manager { border-color: #bfdbfe; }
.cri-manager .cri-icon { background: linear-gradient(135deg, #dbeafe, #93c5fd); color: #1d4ed8; }
.cri-manager.active { border-color: #3b82f6; background: #eff6ff; }
.cri-manager.active .cri-arrow { color: #2563eb; }

.cri-staff { border-color: #bbf7d0; }
.cri-staff .cri-icon { background: linear-gradient(135deg, #d1fae5, #6ee7b7); color: #047857; }
.cri-staff.active { border-color: #10b981; background: #f0fdf4; }
.cri-staff.active .cri-arrow { color: #059669; }

.corp-role-detail {
    margin-bottom: 1rem;
    animation: corpFade .22s ease;
}

.crd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.crd-tag {
    font-size: .65rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: .25rem .5rem;
    border-radius: 6px;
}

.corp-field {
    margin-bottom: 1.15rem;
    animation: corpFade .22s ease;
}

.corp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.corp-input-wrap > i:first-child {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 1rem;
    z-index: 1;
    pointer-events: none;
}

.corp-input {
    width: 100%;
    height: 48px;
    padding: 0 2.75rem 0 2.65rem;
    border: 1.5px solid #efd9ba;
    border-radius: 12px;
    font-size: 16px;
    color: #3b1f0d;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.corp-input:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 4px rgba(217,119,6,.16);
}

.corp-pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    padding: .35rem;
    cursor: pointer;
    z-index: 1;
}
.corp-pw-toggle:hover { color: #2563eb; }

.corp-btn-submit {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    box-shadow: 0 10px 20px rgba(180, 83, 9, .32);
}

.corp-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(180, 83, 9, .38);
}

.corp-btn-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.corp-login-foot {
    text-align: center;
    font-size: .78rem;
    color: #94a3b8;
    margin: 1.25rem 0 0;
}

.corp-login-foot code {
    background: #f1f5f9;
    padding: .15rem .4rem;
    border-radius: 5px;
    font-weight: 700;
    color: #0f172a;
}

.corp-mobile-store {
    display: none;
    text-align: center;
    font-size: .75rem;
    color: #94a3b8;
    margin-top: 1rem;
}

@keyframes corpFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Tablet ─────────────────────────────────────────────── */
@media (max-width: 991px) {
    .corp-login-shell {
        flex-direction: column;
    }

    .corp-login-aside {
        flex: none;
        max-width: none;
        width: 100%;
        padding: 1rem 1rem 1.2rem;
    }

    .corp-aside-inner {
        justify-content: flex-start;
    }

    .corp-login-back { margin-bottom: 1rem; }

    .corp-brand-lockup {
        margin-bottom: 1.25rem;
        align-items: center;
    }

    .corp-brand-logo {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .corp-brand-lockup h1 { font-size: 1.15rem; }
    .corp-tagline { font-size: .78rem; }

    .corp-feature-list {
        display: none;
    }

    .corp-aside-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: .75rem 1.25rem;
    }

    .corp-login-main {
        padding: 0 1rem 1.5rem;
        justify-content: flex-start;
    }

    .corp-login-card {
        max-width: 100%;
        border-radius: 18px;
        padding: 1.45rem 1.2rem;
        box-shadow: 0 -4px 24px rgba(15,23,42,.06);
    }

    .corp-mobile-store { display: block; }
}

/* ─── Mobile phone ───────────────────────────────────────── */
@media (max-width: 575px) {
    .corp-login-aside {
        padding: 1rem 1rem 1.25rem;
    }

    .corp-login-aside::after { height: 3px; }

    .corp-login-card {
        padding: 1.2rem .95rem;
        border-radius: 14px;
    }

    .corp-login-card-head h2 { font-size: 1.2rem; }

    .corp-role-item {
        padding: .85rem .75rem;
        min-height: 56px;
    }

    .cri-icon {
        width: 40px;
        height: 40px;
    }

    .cri-text strong { font-size: .85rem; }

    .cri-text small {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .corp-btn-submit {
        height: 52px;
        font-size: 1rem;
    }

    .corp-aside-meta {
        font-size: .72rem;
        flex-direction: column;
        gap: .35rem;
    }
}

/* Safe area (notched phones) */
@supports (padding: max(0px)) {
    .corp-login-aside,
    .corp-login-main {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .corp-login-main {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}
