/* ═══════════════════════════════════════════════════════════
   style.css  —  Nexus ERP Login Page
   Pure CSS, no third-party libraries, mobile-first responsive
   ═══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue',
                 Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fc;
    color: #111827;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
}

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
    /* Brand */
    --blue-600:    #1a6fe8;
    --blue-700:    #1558c7;
    --blue-800:    #1044a3;

    /* Left panel gradient */
    --panel-start: #1e7cf0;
    --panel-mid:   #1565d8;
    --panel-end:   #0d44a8;

    /* Neutrals */
    --gray-50:     #f8f9fc;
    --gray-100:    #f1f4f8;
    --gray-200:    #e4e9f0;
    --gray-300:    #cbd5e1;
    --gray-400:    #94a3b8;
    --gray-500:    #64748b;
    --gray-600:    #475569;
    --gray-700:    #334155;
    --gray-900:    #111827;

    /* Semantic */
    --text-primary:   #111827;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;
    --border-color:   #e2e8f0;
    --border-focus:   #1a6fe8;

    /* Error */
    --red-500: #ef4444;
    --red-lt:  #fef2f2;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, .08),
                   0 1px 4px  rgba(0, 0, 0, .04);
    --shadow-btn:  0 1px 3px  rgba(26, 111, 232, .35),
                   0 4px 14px rgba(26, 111, 232, .25);

    /* Radii */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  16px;
    --r-xl:  20px;

    /* Transitions */
    --tr-fast:   .15s ease;
    --tr-normal: .22s ease;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT  —  two-column split
   ══════════════════════════════════════════════════════════════ */
body {
    flex-direction: row;
}

/* ── LEFT PANEL ────────────────────────────────────────────── */
.panel-left {
    width: 50%;
    min-height: 100vh;
    background: linear-gradient(
        145deg,
        var(--panel-start) 0%,
        var(--panel-mid)   55%,
        var(--panel-end)  100%
    );
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    position: relative;
    overflow: hidden;
}

/* Subtle radial glare top-left */
.panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 60% at 20% 15%,
        rgba(255,255,255,.12) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Subtle mesh circle decorations */
.panel-left::after {
    content: '';
    position: absolute;
    bottom: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, .05);
    pointer-events: none;
}

/* ── LOGO ──────────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, .18);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .22);
    flex-shrink: 0;
}

.logo-name {
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .95);
    letter-spacing: .01em;
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.22;
    letter-spacing: -.02em;
    margin-bottom: 18px;
}

.hero-sub {
    font-size: .96rem;
    color: rgba(255, 255, 255, .75);
    line-height: 1.65;
    margin-bottom: 40px;
    max-width: 360px;
}

/* ── FEATURES ──────────────────────────────────────────────── */
.features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .9rem;
    color: rgba(255, 255, 255, .85);
    font-weight: 400;
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .9);
    flex-shrink: 0;
}

/* ── LEFT FOOTER ───────────────────────────────────────────── */
.panel-footer {
    font-size: .78rem;
    color: rgba(255, 255, 255, .45);
    position: relative;
    z-index: 1;
    margin-top: 24px;
}

/* ══════════════════════════════════════════════════════════════
   RIGHT PANEL
   ══════════════════════════════════════════════════════════════ */
.panel-right {
    width: 50%;
    min-height: 100vh;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 32px;
    position: relative;
}

/* Subtle dot-grid background */
.panel-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--gray-300) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: .35;
    pointer-events: none;
}

/* ── FORM CARD ─────────────────────────────────────────────── */
.form-card {
    background: #ffffff;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 40px 40px 36px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: card-rise .45s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes card-rise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD HEADING ──────────────────────────────────────────── */
.card-head {
    margin-bottom: 28px;
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.03em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.card-sub {
    font-size: .9rem;
    color: var(--text-secondary);
}

/* ── FIELD GROUP ───────────────────────────────────────────── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.field-label {
    font-size: .83rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forgot-link {
    font-size: .83rem;
    font-weight: 500;
    color: var(--blue-600);
    transition: color var(--tr-fast);
}

.forgot-link:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

/* ── INPUT WRAPPER ─────────────────────────────────────────── */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--tr-fast);
    z-index: 1;
}

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 40px;
    font-size: .9rem;
    color: var(--text-primary);
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field:hover {
    border-color: var(--gray-400);
}

.input-field:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(26, 111, 232, .12);
}

.input-field:focus + .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--blue-600);
}

/* Password field — extra right padding for toggle button */
.input-field--pw {
    padding-right: 42px;
}

/* ── TOGGLE PASSWORD ───────────────────────────────────────── */
.toggle-pw {
    position: absolute;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    border-radius: 4px;
    transition: color var(--tr-fast), background var(--tr-fast);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.toggle-pw:hover {
    color: var(--gray-600);
    background: var(--gray-100);
}

.toggle-pw:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ── FIELD ERROR ───────────────────────────────────────────── */
.field-error {
    font-size: .78rem;
    color: var(--red-500);
    min-height: 1em;
    display: block;
}

/* Highlight input when error shown */
.field-group:has(.field-error:not(:empty)) .input-field {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

/* ── REMEMBER ME ───────────────────────────────────────────── */
.remember-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 22px;
    user-select: none;
}

.custom-check {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.custom-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.check-box {
    display: block;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-400);
    border-radius: 4px;
    background: #ffffff;
    transition: background var(--tr-fast), border-color var(--tr-fast);
    position: relative;
}

/* Checkmark drawn with CSS */
.check-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity var(--tr-fast);
}

.custom-check input:checked ~ .check-box {
    background: var(--blue-600);
    border-color: var(--blue-600);
}

.custom-check input:checked ~ .check-box::after {
    opacity: 1;
}

.custom-check input:focus-visible ~ .check-box {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.remember-text {
    font-size: .87rem;
    color: var(--text-secondary);
}

/* ── SIGN IN BUTTON ────────────────────────────────────────── */
.btn-signin {
    width: 100%;
    height: 46px;
    background: var(--blue-600);
    color: #ffffff;
    font-size: .93rem;
    font-weight: 600;
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    letter-spacing: .015em;
    transition: background var(--tr-fast), box-shadow var(--tr-fast),
                transform var(--tr-fast);
    box-shadow: var(--shadow-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.btn-signin:hover:not(:disabled) {
    background: var(--blue-700);
    box-shadow: 0 2px 6px rgba(26,111,232,.4), 0 6px 20px rgba(26,111,232,.3);
    transform: translateY(-1px);
}

.btn-signin:active:not(:disabled) {
    background: var(--blue-800);
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

.btn-signin:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-signin:focus-visible {
    outline: 3px solid rgba(26, 111, 232, .4);
    outline-offset: 2px;
}

/* ── DIVIDER ───────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    display: block;
}

.divider-text {
    font-size: .72rem;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: .07em;
    white-space: nowrap;
}

/* ── SOCIAL BUTTONS ────────────────────────────────────────── */
.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.btn-social {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md);
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--tr-fast), border-color var(--tr-fast),
                box-shadow var(--tr-fast), transform var(--tr-fast);
}

.btn-social:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
}

.btn-social:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-social:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ── REGISTER LINE ─────────────────────────────────────────── */
.register-line {
    text-align: center;
    font-size: .87rem;
    color: var(--text-secondary);
}

.register-link {
    color: var(--blue-600);
    font-weight: 600;
    transition: color var(--tr-fast);
}

.register-link:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

/* ── RIGHT FOOTER ──────────────────────────────────────────── */
.right-footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    font-size: .78rem;
    color: var(--gray-400);
    text-align: center;
}

.right-footer a {
    color: var(--gray-500);
    transition: color var(--tr-fast);
}

.right-footer a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE  —  breakpoints
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 900px): stack panels ────────────────────────── */
@media (max-width: 900px) {
    body {
        flex-direction: column;
    }

    .panel-left {
        width: 100%;
        min-height: unset;
        padding: 28px 28px 36px;
    }

    .hero {
        flex: unset;
        padding: 20px 0 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-sub {
        margin-bottom: 28px;
        font-size: .9rem;
    }

    .panel-footer {
        display: none;
    }

    .panel-right {
        width: 100%;
        min-height: unset;
        padding: 36px 20px 40px;
    }
}

/* ── Small mobile (≤ 480px) ────────────────────────────────── */
@media (max-width: 480px) {
    .panel-left {
        padding: 22px 20px 30px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .features {
        gap: 12px;
    }

    .feature-item {
        font-size: .85rem;
    }

    .form-card {
        padding: 28px 22px 26px;
        border-radius: var(--r-lg);
    }

    .card-title {
        font-size: 1.35rem;
    }

    .social-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .btn-social {
        font-size: .82rem;
        gap: 7px;
    }
}

/* ── Very small (≤ 360px) ──────────────────────────────────── */
@media (max-width: 360px) {
    .social-row {
        grid-template-columns: 1fr;
    }
}

/* ── Large desktop (≥ 1400px) ─────────────────────────────── */
@media (min-width: 1400px) {
    .panel-left {
        padding: 40px 72px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .form-card {
        padding: 48px 48px 44px;
        max-width: 460px;
    }
}

/* ══════════════════════════════════════════════════════════════
   ACCESSIBILITY — reduced motion
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   FOCUS VISIBLE  — global keyboard nav ring
   ══════════════════════════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}
