/* ==========================================================================
   Acta Collector — Design System
   Dark glassmorphism theme, blue-purple palette
   ========================================================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
    --bg-primary: #0f1117;
    --bg-card: rgba(22, 27, 45, 0.7);
    --bg-input: rgba(15, 17, 23, 0.8);

    --border-card: rgba(100, 120, 255, 0.15);
    --border-input: rgba(100, 120, 255, 0.25);
    --border-input-focus: rgba(120, 100, 255, 0.6);

    --text-primary: #ffffff;
    --text-secondary: #e0e0e6;
    --text-muted: #a0a0b0;
    --text-placeholder: #666680;

    --gradient-brand: linear-gradient(135deg, #4f7df9, #8b5cf6, #a855f7);
    --gradient-button: linear-gradient(135deg, #4f7df9, #7c3aed);
    --gradient-button-hover: linear-gradient(135deg, #6390ff, #8f52f5);
    --gradient-progress: linear-gradient(90deg, #4f7df9, #8b5cf6);

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 4px 15px rgba(79, 125, 249, 0.3);
    --shadow-button-hover: 0 6px 25px rgba(79, 125, 249, 0.45);

    --radius-card: 16px;
    --radius-input: 10px;
    --radius-button: 12px;

    --transition-base: 0.25s ease;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    line-height: 1.6;
}

/* --- Background subtle grid effect --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79, 125, 249, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Layout Container --- */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* --- Header --- */
.header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.header__title {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.header__subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 400;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Cards (glassmorphism + animated border) --- */
.card {
    position: relative;
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1;
    border: 1px solid transparent;
}

/* Animated gradient border */
.card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-card);
    padding: 1px;
    background: conic-gradient(from var(--card-border-angle, 0deg),
            rgba(79, 125, 249, 0.5),
            rgba(139, 92, 246, 0.5),
            rgba(168, 85, 247, 0.4),
            rgba(79, 125, 249, 0.15),
            rgba(139, 92, 246, 0.15),
            rgba(79, 125, 249, 0.5));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 4s linear infinite;
    z-index: -1;
}

@keyframes borderRotate {
    0% {
        --card-border-angle: 0deg;
    }

    100% {
        --card-border-angle: 360deg;
    }
}

@property --card-border-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-input);
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

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

.form-input:focus {
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px rgba(120, 100, 255, 0.15);
}

.form-input--with-icon {
    padding-left: 2.75rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn--primary {
    background: var(--gradient-button);
    box-shadow: var(--shadow-button);
}

.btn--primary:hover:not(:disabled) {
    background: var(--gradient-button-hover);
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-1px);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--download {
    background: var(--gradient-button);
    box-shadow: var(--shadow-button);
    font-size: 0.95rem;
    padding: 0.85rem 1.5rem;
}

.btn--download:hover {
    background: var(--gradient-button-hover);
    box-shadow: var(--shadow-button-hover);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.1rem;
}

/* --- Progress Section --- */
.progress-card {
    text-align: center;
}

.progress-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-progress);
    border-radius: 100px;
    transition: width 0.5s ease;
    position: relative;
    min-width: 0;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-case {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.progress-stats {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.progress-current {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    word-break: break-all;
}

.progress-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.progress-info__icon {
    font-size: 0.9rem;
}

/* --- Status Messages --- */
.status-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-input);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 1rem;
}

.status-message--error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.status-message--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

/* --- Footer --- */
.footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* --- Utility: hidden --- */
.hidden {
    display: none !important;
}

/* --- Spinner animation --- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* --- Responsive --- */
@media (max-width: 600px) {
    body {
        padding: 1.5rem 0.75rem;
    }

    .header__title {
        font-size: 2rem;
    }

    .header__subtitle {
        font-size: 0.85rem;
    }

    .card {
        padding: 1.25rem;
    }
}