/* =============================================
   CSS VARIABLES & RESET
============================================= */
:root {
    --brand-dark:     #1254a0;
    --brand-mid:      #1a74c4;
    --brand-light:    #27aae1;
    --brand-pale:     #e8f4fd;
    --surface:        #f5f8fc;
    --panel-bg:       #ffffff;
    --text-primary:   #0f1e2d;
    --text-secondary: #5a7184;
    --text-muted:     #9ab3c7;
    --border:         #dde8f0;
    --border-focus:   #1a74c4;
    --shadow-sm:      0 1px 3px rgba(18, 84, 160, 0.08);
    --shadow-md:      0 4px 20px rgba(18, 84, 160, 0.12);
    --shadow-lg:      0 12px 40px rgba(18, 84, 160, 0.18);
    --radius-sm:      8px;
    --radius-md:      14px;
    --radius-lg:      24px;
    --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    overflow: hidden;
}

/* =============================================
   LAYOUT
============================================= */
.page-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* =============================================
   LEFT PANEL — BRAND HERO
============================================= */
.brand-panel {
    flex: 0 0 62%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3.5rem 4rem;
}

/* Multi-layer gradient background */
.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 20% 10%, rgba(39, 170, 225, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 55% 70% at 85% 80%, rgba(18, 84, 160, 0.6) 0%, transparent 60%),
        linear-gradient(155deg, #1254a0 0%, #1a74c4 40%, #27aae1 100%);
    z-index: 0;
}

/* Geometric accent circles */
.brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle 280px at 78% 18%, rgba(255, 255, 255, 0.06) 0%, transparent 70%),
        radial-gradient(circle 180px at 10% 88%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    z-index: 0;
}

/* Decorative large ring */
.brand-ring {
    position: absolute;
    top: -120px;
    right: -80px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    z-index: 1;
}

.brand-ring::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 60px;
    right: 60px;
    bottom: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Small accent dot grid */
.brand-dots {
    position: absolute;
    bottom: 140px;
    right: 50px;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
    z-index: 1;
    opacity: 0.7;
}

.brand-content {
    position: relative;
    z-index: 2;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 1.75rem;
    backdrop-filter: blur(8px);
}

.brand-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7de8ff;
    box-shadow: 0 0 8px rgba(125, 232, 255, 0.8);
    animation: pulse-dot 2.2s ease-in-out infinite;
}

.brand-badge-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-company {
    font-family: 'Outfit', sans-serif;
    font-size: 3.6rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.brand-system {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.01em;
    margin-bottom: 2.5rem;
}

.brand-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
}

.stat-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.18);
    align-self: stretch;
}

/* =============================================
   RIGHT PANEL — LOGIN FORM
============================================= */
.form-panel {
    flex: 0 0 38%;
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3rem;
    position: relative;
    box-shadow: -4px 0 30px rgba(18, 84, 160, 0.07);
}

.form-card {
    width: 100%;
    max-width: 360px;
}

/* Logo */
.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 2.25rem;
}

.logo-wrap svg {
    width: 180px;
    height: auto;
}

/* Divider line under logo */
.logo-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin-bottom: 2.25rem;
}

/* Heading */
.form-heading {
    margin-bottom: 0.4rem;
}

.form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.form-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2rem;
}

/* =============================================
   ALERT MESSAGES
============================================= */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    border-width: 1px;
    border-style: solid;
}

.alert-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.alert-error {
    background: #fff5f5;
    color: #c0392b;
    border-color: #fbd5d5;
}

.alert-success {
    background: #f0faf5;
    color: #1a7a4a;
    border-color: #b7ecd4;
}

.alert-info {
    background: #f0f7ff;
    color: #1a5fa8;
    border-color: #b8d9f8;
}

/* =============================================
   FORM FIELDS
============================================= */
.field-group {
    margin-bottom: 1.1rem;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

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

.field-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.field-wrap:focus-within .field-icon {
    color: var(--brand-mid);
}

.field-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}

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

.field-input:focus {
    border-color: var(--border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(26, 116, 196, 0.1);
}

/* Password toggle button */
.toggle-pw {
    position: absolute;
    right: 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.toggle-pw:hover {
    color: var(--text-secondary);
}

.toggle-pw svg {
    width: 17px;
    height: 17px;
}

/* =============================================
   REMEMBER ME CHECKBOX
============================================= */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.75rem;
}

.remember-check {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
}

.remember-check:checked {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
}

.remember-check:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.remember-check:focus {
    box-shadow: 0 0 0 3px rgba(26, 116, 196, 0.15);
    outline: none;
}

.remember-label {
    font-size: 0.83rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* =============================================
   SUBMIT BUTTON
============================================= */
.btn-login {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.975rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(18, 84, 160, 0.3);
    margin-bottom: 1.5rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 7px 20px rgba(18, 84, 160, 0.38);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(18, 84, 160, 0.25);
}

/* =============================================
   REGISTER LINK & FOOTER
============================================= */
.register-row {
    text-align: center;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.register-row a {
    color: var(--brand-mid);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.register-row a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.form-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* =============================================
   ANIMATIONS
============================================= */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Brand panel stagger */
.brand-badge   { animation: slideUp 0.6s 0.00s ease both; }
.brand-company { animation: slideUp 0.6s 0.10s ease both; }
.brand-system  { animation: slideUp 0.6s 0.20s ease both; }
.brand-stats   { animation: slideUp 0.6s 0.30s ease both; }

/* Form panel stagger */
.logo-wrap                  { animation: slideUp 0.55s 0.05s ease both; }
.logo-divider               { animation: fadeIn  0.50s 0.25s ease both; }
.form-heading               { animation: slideUp 0.55s 0.15s ease both; }
.form-subtitle              { animation: slideUp 0.55s 0.20s ease both; }
.field-group:nth-child(1)   { animation: slideUp 0.50s 0.25s ease both; }
.field-group:nth-child(2)   { animation: slideUp 0.50s 0.32s ease both; }
.remember-row               { animation: slideUp 0.50s 0.38s ease both; }
.btn-login                  { animation: slideUp 0.50s 0.44s ease both; }
.register-row               { animation: slideUp 0.50s 0.50s ease both; }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1100px) {
    .brand-company { font-size: 2.9rem; }
    .form-panel    { padding: 2rem; }
}

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

    .page-wrapper  {
        flex-direction: column;
        overflow-y: auto;
    }

    .brand-panel {
        flex: 0 0 auto;
        min-height: 38vh;
        padding: 2.5rem 2rem;
        justify-content: flex-end;
    }

    .brand-company { font-size: 2.4rem; }
    .brand-ring    { display: none; }
    .brand-dots    { display: none; }
    .brand-stats   { display: none; }

    .form-panel {
        flex: 1;
        padding: 2.5rem 1.75rem;
        box-shadow: none;
    }
}