@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =============================================
   RESET & BASE
   ============================================= */

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

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: #0f1420;
    color: #f8fafc;
    overflow: hidden;
}

/* =============================================
   SPLIT LAYOUT
   ============================================= */

.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* =============================================
   LEFT — BRAND PANEL
   ============================================= */

.brand-panel {
    position: relative;
    background: linear-gradient(145deg, #00174b 0%, #092d7f 55%, #c04a00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 52px;
    overflow: hidden;
}

/* Noise texture overlay */
.brand-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

/* Ambient orbs */
.brand-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
}

.brand-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 102, 2, 0.18);
    top: -100px;
    right: -80px;
    animation: orbFloat 10s ease-in-out infinite alternate;
}

.brand-orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(9, 45, 127, 0.4);
    bottom: -60px;
    left: -60px;
    animation: orbFloat 14s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, -30px) scale(1.08); }
}

/* Brand content */
.brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 36px;
    max-width: 400px;
    width: 100%;
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
}

.brand-logo {
    max-width: 200px;
    max-height: 64px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-title {
    font-size: 42px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.brand-desc {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    max-width: 340px;
}

/* Feature list */
.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    animation: slideInLeft 0.6s ease-out both;
}

.brand-features li:nth-child(1) { animation-delay: 0.1s; }
.brand-features li:nth-child(2) { animation-delay: 0.2s; }
.brand-features li:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.feat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.brand-features li:hover .feat-icon {
    background: rgba(255, 102, 2, 0.3);
    border-color: rgba(255, 102, 2, 0.4);
}

/* Security badge */
.brand-secure {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    width: fit-content;
}

.brand-secure i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================
   RIGHT — FORM PANEL
   ============================================= */

.form-panel {
    background: #0f1420;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
}

.form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 10%, rgba(255, 102, 2, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 90%, rgba(9, 45, 127, 0.08) 0%, transparent 55%);
    pointer-events: none;
}

.form-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile logo (hidden on desktop) */
.mobile-logo {
    display: none;
    margin-bottom: 32px;
}

.mobile-logo img {
    max-width: 160px;
    max-height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Form header */
.form-header {
    margin-bottom: 36px;
}

.form-greeting {
    font-size: 12.5px;
    font-weight: 700;
    color: #ff6602;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.form-title {
    font-size: 30px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.form-subtitle {
    font-size: 14px;
    color: #64748b;
    font-weight: 400;
    line-height: 1.5;
}

/* Error alert */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 13.5px;
    font-weight: 500;
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.alert-error i {
    font-size: 15px;
    color: #f87171;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

/* Field groups */
.field-group {
    margin-bottom: 22px;
}

.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 16px;
    font-size: 14px;
    color: #475569;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.field-input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.field-input::placeholder {
    color: #334155;
    font-weight: 400;
}

.field-input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.field-input:focus {
    border-color: rgba(255, 102, 2, 0.5);
    background: rgba(255, 102, 2, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 102, 2, 0.1);
}

.field-input:focus + .toggle-password,
.field-wrap:focus-within .field-icon {
    color: #ff6602;
}

/* Toggle password */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    transition: color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}

/* Submit button */
.btn-login {
    width: 100%;
    padding: 15px 24px;
    margin-top: 8px;
    background: linear-gradient(135deg, #ff6602 0%, #e05500 100%);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 6px 20px rgba(255, 102, 2, 0.3);
    letter-spacing: 0.01em;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 102, 2, 0.4);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 102, 2, 0.3);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Form footer */
.form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}

.form-footer i {
    font-size: 11px;
    color: #475569;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
    body { overflow: auto; }

    .login-page {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 48px 24px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .form-card {
        max-width: 420px;
        margin: 0 auto;
    }

    .mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .form-panel {
        padding: 40px 20px;
    }

    .form-title {
        font-size: 26px;
    }

    .field-input {
        font-size: 16px; /* prevent zoom on iOS */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid rgba(255, 102, 2, 0.6);
    outline-offset: 2px;
}
