/* ==========================================================================
   Digitech IAM Design System - Authentication
   Palette: SHAP Logo (Blue #1565C0 + Orange #F47920)
   Font: Plus Jakarta Sans
   ========================================================================== */

/* ===== CSS VARIABLES ===== */
:root {
    /* Brand Colors */
    --brand-blue: #1565C0;
    --brand-blue-dark: #0D47A1;
    --brand-blue-darker: #0A3470;
    --brand-blue-light: #4791DB;
    --brand-blue-lighter: #E8F1FA;
    --brand-orange: #F47920;
    --brand-orange-dark: #D66A18;
    --brand-orange-light: #F9A55E;
    --brand-orange-lighter: #FEF3E8;

    /* Neutrals */
    --neutral-50: #F7F8FA;
    --neutral-100: #EFF1F5;
    --neutral-200: #E2E6EC;
    --neutral-300: #CDD3DC;
    --neutral-400: #A8B2BF;
    --neutral-500: #7D8A99;
    --neutral-600: #5A6573;
    --neutral-700: #3D4754;
    --neutral-800: #272F3A;
    --neutral-900: #161C26;

    /* Semantic */
    --success: #2E9E6A;
    --success-light: #EAF6F0;
    --danger: #C9383B;
    --danger-light: #FCE9E9;
    --warning: #D4960E;
    --warning-light: #FDF5E0;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.2s var(--ease);
    --transition-fast: all 0.12s var(--ease);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--neutral-700);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-body {
    height: 100vh;
    overflow: hidden;
}

/* ===== MAIN CONTAINER ===== */
.auth-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ===== LEFT SIDE - FORM ===== */
.auth-form-section {
    flex: 1;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 380px;
    z-index: 2;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    gap: 0.75rem;
}

.logo-image {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--neutral-900);
    letter-spacing: -0.02em;
}

.auth-content {
    width: 100%;
}

/* ===== RIGHT SIDE - BRAND PANEL ===== */
.auth-gradient-section {
    flex: 1;
    background: linear-gradient(160deg, #0D47A1 0%, #1565C0 40%, #0F2744 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gradient-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #FFFFFF;
    padding: 2.5rem;
    max-width: 460px;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    /* Subtle noise texture */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

.gradient-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    animation: fadeInUp 0.8s var(--ease);
}

.gradient-subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
    line-height: 1.7;
    animation: fadeInUp 0.8s var(--ease) 0.15s both;
}

/* ===== DECORATIVE ELEMENTS ===== */
.gradient-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: float 8s ease-in-out infinite;
}

.circle-1 {
    width: 280px;
    height: 280px;
    top: -40px;
    right: -40px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: 60px;
    left: -30px;
    animation-delay: 3s;
}

.circle-3 {
    width: 120px;
    height: 120px;
    top: 45%;
    right: 20%;
    background: rgba(244, 121, 32, 0.06);
    animation-delay: 5s;
}

.decoration-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.line {
    position: absolute;
    background: rgba(255, 255, 255, 0.04);
    transform-origin: center;
}

.line-1 {
    width: 1px;
    height: 250px;
    top: 15%;
    left: 25%;
    transform: rotate(15deg);
    animation: pulse 6s ease-in-out infinite;
}

.line-2 {
    width: 1px;
    height: 180px;
    bottom: 25%;
    right: 20%;
    transform: rotate(-25deg);
    animation: pulse 6s ease-in-out infinite 2s;
}

.line-3 {
    width: 1px;
    height: 140px;
    top: 55%;
    left: 55%;
    transform: rotate(40deg);
    animation: pulse 6s ease-in-out infinite 4s;
}

/* ===== FORM STYLES ===== */
.auth-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--neutral-900);
    margin-bottom: 0.375rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--neutral-500);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 0.8125rem;
}

.form-control {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: #FFFFFF;
    color: var(--neutral-800);
}

.form-control::placeholder {
    color: var(--neutral-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(201, 56, 59, 0.12);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--danger);
}

.form-check {
    padding-left: 1.75em;
    margin-bottom: 1.25rem;
}

.form-check .form-check-input {
    float: left;
    margin-left: -1.75em;
    margin-top: 0.2em;
    width: 1em;
    height: 1em;
    border: 1.5px solid var(--neutral-400);
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.form-check-label {
    font-size: 0.8125rem;
    color: var(--neutral-600);
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--brand-blue);
    color: #FFFFFF;
    width: 100%;
    margin-bottom: 0.75rem;
}

.btn-primary:hover {
    background: var(--brand-blue-dark);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.25);
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--neutral-50);
    color: var(--neutral-700);
    border: 1.5px solid var(--neutral-300);
}

.btn-secondary:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-400);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== AUTH LINKS ===== */
.auth-links {
    text-align: center;
    margin-top: 1.25rem;
}

.auth-link {
    color: var(--brand-blue);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-link:hover {
    color: var(--brand-blue-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--neutral-400);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--neutral-200);
}

.auth-divider::before { margin-right: 0.75rem; }
.auth-divider::after { margin-left: 0.75rem; }

/* ===== PASSKEY BUTTON ===== */
.btn-passkey {
    background: var(--neutral-900);
    border: none;
    border-radius: var(--radius);
    padding: 0.6875rem 1.5rem;
    font-weight: 600;
    color: #FFFFFF;
    transition: var(--transition);
    font-size: 0.875rem;
    font-family: inherit;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-passkey:hover {
    background: var(--neutral-800);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-passkey:focus {
    background: var(--neutral-800);
    box-shadow: 0 0 0 3px rgba(22, 28, 38, 0.2);
    color: #FFFFFF;
}

.btn-passkey:active {
    transform: translateY(0);
    color: #FFFFFF;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 500;
}

.alert-success {
    background-color: var(--success-light);
    border-color: rgba(46, 158, 106, 0.2);
    color: #1B6B45;
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: rgba(201, 56, 59, 0.2);
    color: #8C2022;
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: rgba(212, 150, 14, 0.2);
    color: #7A5500;
}

.alert-info {
    background-color: var(--brand-blue-lighter);
    border-color: rgba(21, 101, 192, 0.2);
    color: var(--brand-blue-dark);
}

/* ===== LOADING STATE ===== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-form-section {
        flex: none;
        height: 60vh;
        padding: 1.5rem;
    }

    .auth-gradient-section {
        flex: none;
        height: 40vh;
    }

    .gradient-title {
        font-size: 2rem;
    }

    .gradient-subtitle {
        font-size: 0.9375rem;
    }
}

@media (max-width: 768px) {
    .auth-form-section {
        height: 70vh;
        padding: 1.25rem;
    }

    .auth-gradient-section {
        height: 30vh;
    }

    .auth-form-wrapper {
        max-width: 340px;
    }

    .auth-logo {
        margin-bottom: 2rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    .gradient-title {
        font-size: 1.625rem;
    }

    .gradient-subtitle {
        font-size: 0.875rem;
    }

    .decoration-circle {
        display: none;
    }

    .line {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-form-section {
        padding: 1rem;
    }

    .auth-form-wrapper {
        max-width: 100%;
    }

    .form-control {
        padding: 0.625rem 0.75rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
    }

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

    .gradient-subtitle {
        font-size: 0.8125rem;
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.w-100 { width: 100%; }

.text-primary { color: var(--brand-blue); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--brand-blue-light); }
.text-muted { color: var(--neutral-500); }
