/* === IMPORTAÇÕES === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === CSS VARIABLES === */
:root {
    /* Cores Principais */
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #64748b;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    
    /* Cores de Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f0f9ff;
    --bg-success: #dcfce7;
    --bg-error: #fef2f2;
    
    /* Cores de Texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Bordas */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-focus: var(--primary);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transições */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Raios */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Espaçamentos */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}

/* === RESET GLOBAL === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === CONTAINER === */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* === HEADER === */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-8) 0;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.logo {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    display: inline-block;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
}

.header h1 {
    color: var(--primary-dark);
    margin-bottom: var(--space-2);
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
}

/* === MAIN === */
.main {
    padding: var(--space-8) 0;
}

/* === FORM === */
.form {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.form-section {
    margin-bottom: var(--space-8);
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h2 {
    margin-bottom: var(--space-5);
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}

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

/* === ESTUDANTES === */
.students-container {
    margin-bottom: var(--space-4);
}

.student-input {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    align-items: center;
    padding: var(--space-3);
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    border: 1px solid #bae6fd;
    transition: var(--transition);
}

.student-input:hover {
    background: #e0f2fe;
    transform: translateX(2px);
}

.student-name {
    flex: 1;
    margin: 0 !important;
}

.remove-student-btn {
    background: var(--error);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.remove-student-btn:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* === DROP ZONE === */
.drop-zone {
    border: 2px dashed var(--text-muted);
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    text-align: center;
    background: var(--bg-accent);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: var(--space-4);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: #dbeafe;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.drop-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.drop-zone p {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
}

.drop-zone small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.photo-counter {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    display: inline-block;
    border: 1px solid var(--border-light);
}

/* === PHOTOS PREVIEW === */
.photos-preview {
    animation: fadeInUp 0.3s ease-out;
}

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

.photos-preview h3 {
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
}

.photo-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: rgba(220, 38, 38, 0.9);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.remove-photo-btn:hover {
    background: var(--error);
    transform: scale(1.1);
}

/* === BUTTONS === */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-white);
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.3);
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* === PROGRESS === */
.progress-container {
    background: var(--bg-accent);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin: var(--space-8) 0;
    animation: fadeInUp 0.3s ease-out;
}

.progress-bar {
    position: relative;
    background: var(--border-light);
    height: 28px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

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

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

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.progress-step {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.progress-step.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
    border-color: #93c5fd;
    transform: translateX(4px);
}

.progress-step.completed {
    background: var(--bg-success);
    color: var(--success);
    border-color: #86efac;
}

.progress-step.completed::before {
    content: '✓';
    font-weight: bold;
}

.progress-step.active::before {
    content: '⟳';
    animation: spin 1s linear infinite;
}

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

/* === POPUP === */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease-out;
}

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

.popup-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: popupEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.popup-icon {
    font-size: 5rem;
    margin-bottom: var(--space-4);
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-8px); }
}

.popup-content h3 {
    color: var(--success);
    margin-bottom: var(--space-5);
    font-size: 1.8rem;
    font-weight: 700;
}

.popup-details {
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    text-align: left;
    border: 1px solid #bae6fd;
}

.popup-details p {
    margin-bottom: var(--space-3);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    line-height: 1.5;
}

.popup-details p:last-child {
    margin-bottom: 0;
}

.popup-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .header {
        padding: var(--space-6) 0;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .form {
        padding: var(--space-6);
    }
    
    .drop-zone {
        padding: var(--space-8);
    }
    
    .drop-icon {
        font-size: 3rem;
    }
    
    .photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .popup-content {
        padding: var(--space-6);
        margin: var(--space-4);
    }
    
    .popup-icon {
        font-size: 4rem;
    }
    
    .popup-content h3 {
        font-size: 1.5rem;
    }
    
    .student-input {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }
    
    .student-name {
        width: 100%;
    }
    
    .remove-student-btn {
        align-self: flex-end;
        width: 36px;
        height: 36px;
    }
    
    .progress-steps {
        font-size: 0.8rem;
    }
    
    .btn-primary {
        padding: var(--space-4) var(--space-6);
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-actions {
        gap: var(--space-2);
    }
    
    .btn-primary {
        padding: var(--space-3) var(--space-5);
        font-size: 0.95rem;
    }
    
    .form-section h2 {
        font-size: 1.1rem;
    }
}

/* === UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === LOADING STATES === */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading .btn-primary {
    cursor: not-allowed;
}

/* === DARK MODE SUPPORT (OPCIONAL) === */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e293b;
        --bg-secondary: #0f172a;
        --bg-accent: #1e3a8a;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-light: #334155;
        --border-medium: #475569;
    }
}

/* === PRINT STYLES === */
@media print {
    .header, .popup-overlay, .progress-container {
        display: none !important;
    }
    
    .form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
