@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   GAMMACO Self-Service Portal — Global Stylesheet
   Version: 1.0.0
   ========================================================================== */

/* ─── 1. Design Tokens ─────────────────────────────────────────────────── */
:root {
    color-scheme: light;

    /* Brand Colors */
    --brand-primary: #10B981;
    --brand-dark: #047857;
    --brand-light: #D1FAE5;
    --brand-bg: #ECFDF5;

    /* Status Colors */
    --status-pending-bg: #FEF3C7;
    --status-pending-text: #92400E;
    --status-inprog-bg: #DBEAFE;
    --status-inprog-text: #1E40AF;
    --status-approved-bg: #D1FAE5;
    --status-approved-text: #065F46;
    --status-resolved-bg: #D1FAE5;
    --status-resolved-text: #065F46;
    --status-rejected-bg: #FEE2E2;
    --status-rejected-text: #991B1B;
    --status-cancelled-bg: #F1F5F9;
    --status-cancelled-text: #475569;

    /* Backgrounds */
    --bg-base: #F8FAFC;
    --bg-surface: rgba(255, 255, 255, 0.95);
    --bg-card: #FFFFFF;

    /* Typography Colors */
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-inverse: #FFFFFF;

    /* Borders & Inputs */
    --line: #E2E8F0;
    --input-bg: #F8FAFC;

    /* Typography */
    --font-body: 'Prompt', sans-serif;
    --font-display: 'Noto Sans Thai', sans-serif;
    --font-th: var(--font-display); /* Alias for backward compatibility */

    /* Radii & Shadows */
    --radius-card: 20px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 40px rgba(16, 185, 129, 0.22);
}

/* ─── 2. Universal Reset & Base ────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    margin: 0;
    display: flex;
    justify-content: center;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
}

/* ─── 3. Layout Components ─────────────────────────────────────────────── */
.container {
    max-width: 480px;
    width: 100%;
    padding: 0;
    margin: 0 auto;
    position: relative;
}

.card-custom {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    padding: 20px;
    margin: 0 16px 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    animation: slideUp 0.4s ease-out;
}

/* ─── 4. Header & Logo ─────────────────────────────────────────────────── */
.card-header-custom {
    background: transparent;
    padding: 24px 20px 16px;
    text-align: center;
    animation: fadeInDown 0.6s ease-out;
}

.card-header-custom h3 {
    font-weight: 500;
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.logo-container {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.logo-img {
    height: clamp(52px, 10vw, 72px);
    max-width: 220px;
    width: auto;
    object-fit: contain;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ─── 5. Form Controls ─────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    background-color: var(--input-bg);
    color: var(--text-main);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background-color: var(--bg-card);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-label {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label i {
    color: var(--brand-primary);
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ─── 6. Buttons ───────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-inverse);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.4s, opacity 0.4s;
}

.btn-primary:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: 0s;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ─── 7. Loading Skeletons ─────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--line) 25%, var(--bg-card) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ─── 8. Shared Animations ─────────────────────────────────────────────── */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── 9. SweetAlert2 Customization ─────────────────────────────────────── */
.swal2-popup {
    border-radius: 20px !important;
    padding: 1.5em !important;
    font-family: var(--font-body) !important;
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

.swal2-title,
.swal2-html-container {
    color: var(--text-main) !important;
}

.swal2-confirm {
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%) !important;
}

.swal2-cancel {
    border-radius: 12px !important;
    padding: 12px 24px !important;
}

/* ─── 10. Accessibility (Reduced Motion) ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
