@font-face {
    font-family: 'Inter Tight';
    src: url('fonts/InterTightVariable.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 92%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96%;
    --muted-foreground: 0 0% 45%;
    --accent: 0 0% 96%;
    --accent-foreground: 0 0% 9%;
    --border: 0 0% 90%;
    --input: 0 0% 90%;
    --ring: 0 0% 20%;
    --skeleton: 0 0% 90%;
    --radius: 0.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: hsl(var(--muted));
    color: hsl(var(--foreground));
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 700px;
}

/* Login Card */
.login-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 480px;
    margin: 0 auto;
}

.login-card h1 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}

.subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.subtitle--login {
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 1px solid hsl(var(--input));
    border-radius: calc(var(--radius) - 2px);
    background: hsl(var(--background));
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    width: 100%;
}

.btn-primary:hover {
    background: hsl(var(--primary) / 0.9);
}

.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
    background: hsl(var(--secondary) / 0.8);
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background: hsl(0 84.2% 60.2% / 0.1);
    border: 1px solid hsl(0 84.2% 60.2% / 0.2);
    color: hsl(0 72.2% 50.6%);
}

.alert-info {
    background: hsl(0 0% 45% / 0.1);
    border: 1px solid hsl(0 0% 45% / 0.2);
    color: hsl(0 0% 30%);
}

/* Bonus Container */
.bonus-container {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Bonus Sections */
.bonus-section {
    margin-bottom: 3rem;
}

.bonus-section:nth-child(3) {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid hsl(var(--border));
}

/* Records List */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.record-card {
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    padding: 0.875rem;
    background: hsl(var(--background));
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.record-header-left {
    flex: 1;
    min-width: 0;
}

.record-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.record-customer {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    display: block;
}

.bonus-amount {
    font-size: 1.08rem;
    font-weight: 600;
    color: hsl(142.1 76.2% 36.3%);
    white-space: nowrap;
}

.record-details {
    border-top: 1px solid hsl(var(--border));
    padding-top: 0.625rem;
}

.detail-single {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

.detail-value {
    font-size: 0.8125rem;
    color: hsl(var(--foreground));
    font-weight: 500;
}

/* Total Card */
.total-card {
    background: hsl(var(--accent));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    padding: 1rem;
    margin-top: 1rem;
}

.total-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.total-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.total-amount {
    font-size: 1.35rem;
    font-weight: 600;
    color: hsl(142.1 76.2% 36.3%);
}

.total-note {
    font-size: 0.6875rem;
    color: hsl(var(--muted-foreground));
    font-style: italic;
    margin-top: 0.25rem;
}

.cf-turnstile {
    margin-bottom: 1.5rem;
}

/* Skeleton Loaders */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-card {
    border: 1px solid hsl(0 0% 95%);
    border-radius: calc(var(--radius) - 2px);
    padding: 0.875rem;
    background: hsl(var(--background));
    /*animation: skeleton-pulse 1.5s ease-in-out infinite;*/
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.skeleton-title {
    height: 1.25rem;
    width: 60%;
    background: hsl(var(--skeleton));
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-amount {
    height: 1.25rem;
    width: 80px;
    background: hsl(var(--skeleton));
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.skeleton-detail {
    height: 1rem;
    width: 40%;
    background: hsl(var(--skeleton));
    border-radius: 4px;
    padding-top: 0.625rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.skeleton-total {
    background: hsl(var(--skeleton));
    border-radius: calc(var(--radius) - 2px);
    padding: 1rem;
    margin-top: 1rem;
    height: 60px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

/* Loading Message Overlay */
.loading-overlay {
    position: absolute;
    top: 2rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 10;
    pointer-events: none;
}

#loading-message {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 500px;
    z-index: 20;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    background: #1066ED;
    color: #ffffff;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }

    .login-card,
    .bonus-container {
        padding: 1.5rem;
    }

    .header {
        flex-direction: column;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .record-card,
    .skeleton-card {
        padding: 0.75rem;
    }

    .record-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .record-title {
        font-size: 0.875rem;
    }
    
    .record-customer {
        font-size: 0.75rem;
    }

    .bonus-amount {
        font-size: 1.125rem;
    }

    .total-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .total-amount {
        font-size: 1.375rem;
    }

    .detail-single {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .skeleton-title {
        width: 80%;
    }
}