/* ===========================================
   FORMULÁRIO DE INSTALAÇÃO - ESTILO MODERNO
   =========================================== */

/* Container Principal */
.form-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-wrapper {
    max-width: 700px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

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

/* Header do Formulário */
.form-header {
    background: linear-gradient(135deg, var(--cor-tipira) 0%, var(--cor-tipira-escuro) 100%);
    padding: 30px;
    text-align: center;
    color: white;
    position: relative;
}

.btn-back-to-home {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-back-to-home:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-back-to-home i {
    font-size: 16px;
}

.form-header h1 {
    font-size: clamp(24px, 5vw, 32px);
    margin: 0 0 10px 0;
    font-weight: 700;
}

.form-header p {
    margin: 0;
    opacity: 0.9;
    font-size: clamp(14px, 3vw, 16px);
}

.form-header .logo-mini {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    border-radius: 50%;
    background: white;
    padding: 8px;
}

/* Progress Bar */
.progress-container {
    padding: 30px 30px 20px;
    background: #f8f9fa;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cor-tipira), var(--cor-tipira-escuro));
    transition: width 0.4s ease;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 3px solid white;
}

.step.active .step-circle {
    background: var(--cor-tipira);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-circle {
    background: #4caf50;
    color: white;
}

.step.completed .step-circle::before {
    content: '✓';
    font-size: 18px;
}

.step-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.step.active .step-label {
    color: var(--cor-tipira);
    font-weight: 700;
}

/* Form Body */
.form-body {
    padding: 40px 30px;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

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

.step-title {
    font-size: 22px;
    color: var(--cor-tipira);
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-title i {
    font-size: 28px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

label .optional {
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s;
}

input,
select {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--fonte-poppins);
    transition: all 0.3s ease;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--cor-tipira);
    box-shadow: 0 0 0 4px rgba(253, 101, 0, 0.1);
}

input:focus + .input-icon,
select:focus + .input-icon {
    color: var(--cor-tipira);
}

input.error,
select.error {
    border-color: #f44336;
}

input.success,
select.success {
    border-color: #4caf50;
}

.error-message {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

input.error ~ .error-message,
select.error ~ .error-message {
    display: block;
}

.success-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #4caf50;
    font-size: 18px;
    display: none;
}

input.success ~ .success-icon {
    display: block;
}

/* Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--fonte-poppins);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-prev {
    background: #f5f5f5;
    color: #666;
}

.btn-prev:hover {
    background: #e0e0e0;
    transform: translateX(-5px);
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, var(--cor-tipira), var(--cor-tipira-escuro));
    color: white;
    flex: 1;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 101, 0, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Modal de Sucesso */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalPop 0.4s ease;
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon i {
    font-size: 40px;
    color: white;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 10px;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
}

.btn-back-home {
    background: linear-gradient(135deg, var(--cor-tipira), var(--cor-tipira-escuro));
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(253, 101, 0, 0.4);
}

/* Loading State */
.cep-loading {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.cep-loading.active {
    display: block;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--cor-tipira);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 20px 15px;
    }

    .form-wrapper {
        border-radius: 15px;
    }

    .form-header {
        padding: 25px 20px;
    }

    .btn-back-to-home {
        top: 15px;
        left: 15px;
        font-size: 13px;
        padding: 6px 12px;
    }

    .progress-container {
        padding: 25px 20px 15px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .form-body {
        padding: 30px 20px;
    }

    .step-title {
        font-size: 20px;
    }

    .form-navigation {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .btn-prev {
        order: 2;
    }

    .btn-next,
    .btn-submit {
        order: 1;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        margin-bottom: 10px;
    }

    .step-label {
        display: none;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input,
    select {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
}
