/* ========================================
   Check-in Fotografia PIB Curitiba
   Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #6B46C1;
    --primary-dark: #553C9A;
    --primary-light: #805AD5;
    --secondary-color: #38A169;
    --error-color: #E53E3E;
    --warning-color: #DD6B20;
    --background: #F7FAFC;
    --surface: #FFFFFF;
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-text h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-text .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* DateTime Display */
.datetime-display {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.datetime-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.datetime-icon {
    font-size: 1.25rem;
}

.datetime-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-icon {
    font-size: 1rem;
}

.optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Inputs */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.15);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Field Hints */
.field-hint {
    font-size: 0.75rem;
    min-height: 1rem;
    display: block;
}

.field-hint.error {
    color: var(--error-color);
}

.field-hint.success {
    color: var(--secondary-color);
}

.cookie-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    display: block;
    margin-top: 4px;
}

input.invalid {
    border-color: var(--error-color);
}

input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

input.valid {
    border-color: var(--secondary-color);
}

input.valid:focus {
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.15);
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.5);
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loading[hidden] {
    display: none;
}

/* Success Card */
.success-card {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.success-card h2 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.success-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.checkin-summary {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.summary-value {
    font-weight: 500;
    color: var(--text-primary);
}

.notification-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.info-icon {
    font-size: 1.25rem;
}

/* Error Card */
.error-card {
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.error-card h2 {
    color: var(--error-color);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Duplicate Card */
.duplicate-card {
    text-align: center;
}

.duplicate-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.duplicate-card h2 {
    color: var(--warning-color);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.duplicate-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.footer p {
    margin-bottom: 4px;
}

.version {
    opacity: 0.6;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.confirm-details {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.confirm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.confirm-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.confirm-icon {
    font-size: 1.25rem;
}

.confirm-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.confirm-question {
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0 !important;
}

.modal-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 20px;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .logo-text h1 {
        font-size: 1.25rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1A202C;
        --surface: #2D3748;
        --text-primary: #F7FAFC;
        --text-secondary: #CBD5E0;
        --text-muted: #A0AEC0;
        --border-color: #4A5568;
    }

    body {
        background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
    }

    input, select, textarea {
        background: #1A202C;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .header, .footer, .btn {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
