/* ========================================
   Instituto Videira Educacional - Formulário de Leads
   Paleta de Cores: Verde Teal (baseado na logo)
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Teal Colors (from logo) */
    --color-teal: #3D8075;
    --color-teal-light: #4A9A8C;
    --color-teal-lighter: #5BB5A6;
    --color-teal-dark: #2D6359;
    --color-teal-darker: #1E4A42;

    /* Secondary/Accent Colors */
    --color-accent: #2A9D8F;
    --color-accent-light: #40C4B5;
    --color-accent-dark: #1F7A6E;

    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-gray-50: #F8FAF9;
    --color-gray-100: #F0F5F4;
    --color-gray-200: #E0E8E6;
    --color-gray-300: #C5D4D1;
    --color-gray-400: #8FA9A3;
    --color-gray-500: #5E7D76;
    --color-gray-600: #3F5B55;
    --color-gray-700: #2D4440;
    --color-gray-800: #1A2B28;
    --color-gray-900: #0D1614;

    /* Semantic Colors */
    --color-error: #DC2626;
    --color-error-light: #FEE2E2;
    --color-success: #059669;
    --color-success-light: #D1FAE5;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--color-teal-light) 0%, var(--color-teal) 50%, var(--color-teal-dark) 100%);
    --gradient-button: linear-gradient(135deg, var(--color-teal-light) 0%, var(--color-teal) 100%);
    --gradient-button-hover: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
    --gradient-bg: linear-gradient(135deg, #0F2420 0%, #1A3832 50%, #0D1C19 100%);

    /* Shadows */
    --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);
    --shadow-glow: 0 0 40px rgba(61, 128, 117, 0.3);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    color: var(--color-gray-800);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    z-index: -2;
}

.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--color-teal-light);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--color-teal);
    top: 50%;
    right: -150px;
    animation-delay: -7s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--color-teal-dark);
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    75% {
        transform: translate(10px, -10px) rotate(3deg);
    }
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: var(--spacing-2xl);
    gap: var(--spacing-lg);
}

/* Form Card */
.form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    padding: var(--spacing-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.form-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(61, 128, 117, 0.3));
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

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

.required-note {
    font-size: 0.8rem;
    color: var(--color-gray-400);
    margin-top: var(--spacing-sm);
}

/* Form Sections */
.form-section {
    background: var(--color-gray-50);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-700);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: var(--spacing-xs);
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-teal);
}

.section-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.section-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-gray-400);
    margin-left: auto;
}

/* Form Row (Two Columns) */
.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        /* Stack inputs vertically */
        gap: var(--spacing-sm);
    }

    .container {
        padding: var(--spacing-md);
        padding-top: var(--spacing-xl);
    }

    .form-card {
        padding: var(--spacing-lg);
    }

    .form-section {
        padding: var(--spacing-md);
    }
}

/* Info Box */
.info-box {
    background: rgba(61, 128, 117, 0.1);
    border: 1px solid rgba(61, 128, 117, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
    color: var(--color-teal-dark);
}

/* File Input */
.form-file {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--color-white);
    border: 2px dashed var(--color-gray-300);
    border-radius: var(--radius-lg);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.form-file:hover {
    border-color: var(--color-teal);
    background: rgba(61, 128, 117, 0.05);
}

.form-file:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 4px rgba(61, 128, 117, 0.1);
}

.file-hint {
    font-size: 0.75rem;
    color: var(--color-gray-400);
    margin-top: -4px;
}

/* Info Text (explanatory notes) */
.info-text {
    font-size: 0.75rem;
    color: #d97706;
    line-height: 1.4;
    margin-top: var(--spacing-xs);
}

/* Checkbox Inline */
.checkbox-inline {
    margin-top: var(--spacing-xs);
}

.checkbox-inline .checkbox-label {
    flex-direction: row;
    align-items: center;
}

/* Form Styles */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-700);
}

.label-icon {
    width: 18px;
    height: 18px;
    color: var(--color-teal);
    flex-shrink: 0;
}

.required {
    color: var(--color-error);
}

.form-input,
.form-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    /* Prevent flex item overflow */
    /* Prevent overflow */
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    color: var(--color-gray-800);
    transition: all var(--transition-normal);
    outline: none;
}

/* Force date input to respect width */
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    width: 100% !important;
}

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

.form-input:hover,
.form-select:hover {
    border-color: var(--color-gray-300);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--color-teal);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(61, 128, 117, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    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='%2364748B' 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 1rem center;
    background-size: 18px;
    padding-right: 2.5rem;
}

/* Error States */
.error-message {
    font-size: 0.8rem;
    color: var(--color-error);
    display: none;
    padding-left: var(--spacing-xs);
}

.form-group.error .form-input,
.form-group.error .form-select {
    border-color: var(--color-error);
    background: var(--color-error-light);
}

.form-group.error .error-message {
    display: block;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Checkbox */
.checkbox-group {
    margin-top: var(--spacing-sm);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    cursor: pointer;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.checkbox-label input:checked~.checkmark {
    background: var(--gradient-button);
    border-color: var(--color-teal);
}

.checkbox-label input:checked~.checkmark::after {
    opacity: 1;
}

.checkbox-label:hover .checkmark {
    border-color: var(--color-teal);
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    line-height: 1.5;
}

.link {
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.link:hover {
    color: var(--color-teal-dark);
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-white);
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-md);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-button-hover);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(61, 128, 117, 0.4);
}

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

.btn-text,
.btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading State */
.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    opacity: 0;
}

.btn-loader {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-loader {
    opacity: 1;
}

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

/* Success Message */
.success-message {
    text-align: center;
    padding: var(--spacing-2xl);
}

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

.success-message.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--color-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--color-success);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: var(--spacing-sm);
}

.success-text {
    font-size: 1rem;
    color: var(--color-gray-500);
    margin-bottom: var(--spacing-xl);
}

.reset-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-teal);
    background: transparent;
    border: 2px solid var(--color-teal);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.reset-btn:hover {
    background: var(--color-teal);
    color: var(--color-white);
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-md);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.footer p {
    margin: var(--spacing-xs) 0;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: var(--spacing-md);
    }

    .form-card {
        padding: var(--spacing-xl);
        border-radius: var(--radius-xl);
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .form-section {
        padding: var(--spacing-md);
    }

    .form-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .form-row .form-group {
        flex: 1 !important;
    }

    .shape-1 {
        width: 300px;
        height: 300px;
    }

    .shape-2 {
        width: 250px;
        height: 250px;
    }

    .shape-3 {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 400px) {
    .form-card {
        padding: var(--spacing-lg);
    }

    .form-input,
    .form-select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 0.875rem 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.form-select:focus-visible,
.submit-btn:focus-visible,
.reset-btn:focus-visible,
.checkbox-label input:focus-visible~.checkmark {
    outline: 3px solid var(--color-cyan);
    outline-offset: 2px;
}