/* ═══════════════════════════════════════════════════════════════
   Employee Advocacy Platform — Design System
   Brand: nusa.id cloud
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ────────────────────────────────────── */
:root {
    /* Brand Colors — nusa.id */
    --primary:        #DC2626;
    --primary-light:  #EF4444;
    --primary-dark:   #B91C1C;
    --primary-50:     #FEF2F2;
    --primary-100:    #FEE2E2;

    --accent:         #1E40AF;
    --accent-light:   #3B82F6;
    --accent-dark:    #1E3A8A;

    --success:        #16A34A;
    --warning:        #D97706;
    --danger:         #DC2626;
    --info:           #2563EB;

    /* Neutrals */
    --gray-50:   #F9FAFB;
    --gray-100:  #F3F4F6;
    --gray-200:  #E5E7EB;
    --gray-300:  #D1D5DB;
    --gray-400:  #9CA3AF;
    --gray-500:  #6B7280;
    --gray-600:  #4B5563;
    --gray-700:  #374151;
    --gray-800:  #1F2937;
    --gray-900:  #111827;

    /* Surfaces — Light Theme */
    --bg-primary:    #FFFFFF;
    --bg-secondary:  #F3F4F6;
    --bg-card:       #FFFFFF;
    --bg-dark:       #111827;

    --text-primary:    #111827;
    --text-secondary:  #374151;
    --text-muted:      #6B7280;
    --text-light:      #9CA3AF;
    --text-on-primary: #FFFFFF;

    --border-color:    #E5E7EB;
    --border-light:    #F3F4F6;

    /* Typography — nusa.id */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:    'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Sizes */
    --text-xs:    0.75rem;
    --text-sm:    0.875rem;
    --text-base:  1rem;
    --text-lg:    1.125rem;
    --text-xl:    1.25rem;
    --text-2xl:   1.5rem;
    --text-3xl:   1.875rem;
    --text-4xl:   2.25rem;
    --text-5xl:   3rem;

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Radius — nusa.id uses 12px consistently */
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-2xl:  24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl:   0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast:   150ms ease;
    --transition-base:   250ms ease;
    --transition-slow:   350ms ease;
}


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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-on-primary);
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.btn-google {
    background: #FFFFFF;
    color: var(--text-primary);
    font-weight: 600;
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    font-size: var(--text-base);
    gap: var(--space-3);
}

.btn-google:hover {
    background: var(--gray-50);
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}


/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}


/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}


/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

.badge-bronze  { background: #FEF3C7; color: #92400E; }
.badge-silver  { background: #F3F4F6; color: #374151; }
.badge-gold    { background: #FEF9C3; color: #854D0E; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }


/* ── Toast Notifications ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 420px;
    animation: slideInRight 350ms ease forwards;
    font-size: var(--text-sm);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info);    }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--space-1);
    font-size: var(--text-lg);
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-secondary);
}

.toast.removing {
    animation: slideOutRight 300ms ease forwards;
}


/* ── Loading Spinner ──────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}


/* ── Utility Classes ──────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.text-center   { text-align: center; }
.text-sm       { font-size: var(--text-sm); }
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

.hidden { display: none !important; }


/* ── Keyframe Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }


/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .toast-container {
        top: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
    }

    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    :root {
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
    }
}
