/* ===================================
   RESET E VARIÁVEIS
=================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Principais */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Tons de Cinza */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espaçamentos */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* ===================================
   BODY E CONTAINER
=================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: var(--spacing-md);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ===================================
   HEADER
=================================== */
.header {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header-content h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    opacity: 0.95;
    font-weight: 300;
}

/* ===================================
   SECTIONS
=================================== */
.section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.section-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

/* ===================================
   FORM GRID
=================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ===================================
   LABELS E INPUTS
=================================== */
label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-xs);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: all 0.3s ease;
    background: var(--gray-50);
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em;
    padding-right: 2.5rem;
}

/* ===================================
   MEDIDA CARDS
=================================== */
.medida-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 2px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.medida-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.medida-header {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-sm);
}

.medida-header h3 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--gray-800);
    font-weight: 600;
}

.medida-card .form-grid {
    margin-bottom: 0;
}

/* ===================================
   UPLOAD AREA
=================================== */
.upload-area {
    position: relative;
    margin-bottom: var(--spacing-md);
}

#fileInput {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: var(--spacing-sm);
}

.upload-text {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-xs);
    font-size: clamp(1rem, 3vw, 1.1rem);
}

.upload-hint {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: var(--gray-500);
}

/* ===================================
   FILE PREVIEW
=================================== */
.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.file-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-100);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.file-item:hover {
    transform: scale(1.05);
}

.file-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.file-item.no-preview {
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
}

.file-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.file-name {
    font-size: 0.7rem;
    color: var(--gray-600);
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.file-remove:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ===================================
   BUTTONS
=================================== */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: clamp(0.95rem, 3vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

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

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    width: 100%;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ===================================
   DECORAÇÃO (NOMES E NÚMEROS)
=================================== */
.btn-decoracao {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    font-family: inherit;
}

.btn-decoracao:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.decoracao-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-color);
}

.decoracao-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.decoracao-header h4 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.jogadores-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.jogador-item {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.jogador-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.jogador-item-header h5 {
    font-size: 1rem;
    color: var(--gray-700);
}

.btn-remove-jogador {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-remove-jogador:hover {
    transform: scale(1.1);
}

.jogador-fields {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

/* ===================================
   SUBMIT SECTION
=================================== */
.submit-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   LOADING OVERLAY
=================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

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

/* ===================================
   MODAL
=================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-icon {
    font-size: clamp(3rem, 10vw, 4rem);
    margin-bottom: var(--spacing-md);
}

.modal-content h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

.modal-content p {
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
    font-size: clamp(0.95rem, 3vw, 1.1rem);
}

/* ===================================
   RESPONSIVE
=================================== */

/* Tablets */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .header {
        padding: var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-md);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.25rem;
        --spacing-xl: 2rem;
    }
    
    body {
        padding: 0.5rem;
    }
    
    .header {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .medida-card {
        padding: var(--spacing-sm);
    }
    
    .upload-label {
        padding: var(--spacing-lg);
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
    }
    
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .section {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
