/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-input: #0f0f16;
    --accent-primary: #00d4aa;
    --accent-secondary: #00a885;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --border-color: #2a2a3a;
    --border-focus: #00d4aa;
    --error: #ff4757;
    --success: #00d4aa;
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 168, 133, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    text-shadow: 0 0 30px var(--accent-glow);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* Form */
.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Sections */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 212, 170, 0.1);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-icon {
    color: var(--accent-primary);
    font-size: 0.875rem;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Labels */
.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder {
    color: var(--text-muted);
}

/* Select Dropdown */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b9e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Stamp Preview */
.stamp-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-input);
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
    min-height: 120px;
}

.stamp-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.stamp-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    background: var(--accent-glow);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.stamp-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stamp-text strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.stamp-text span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 120px;
}

.file-upload:hover .file-upload-label,
.file-upload.has-file .file-upload-label {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.05);
}

.upload-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    display: block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    background: var(--accent-glow);
    border-radius: 50%;
}

.upload-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    word-break: break-all;
}

.file-upload.has-file .file-name {
    color: var(--accent-primary);
}

/* Submit Button */
.form-actions {
    margin-top: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 12px;
    color: var(--bg-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Date/Time input styling for webkit */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* Number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Animation for form load */
.form-section {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }
.form-section:nth-child(4) { animation-delay: 0.4s; }
.form-section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-actions {
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}
