/* ========================================
   CPF PAGE STYLES
   ======================================== */

.cpf-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #F0F4F8 0%, #E0EAFC 40%, #CFDEF3 100%);
    position: relative;
    overflow: hidden;
}

/* Background Decorations */
.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #3B82F6, transparent 70%);
    top: -150px;
    right: -100px;
    animation: floatCircle 20s ease-in-out infinite;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #06B6D4, transparent 70%);
    bottom: -100px;
    left: -80px;
    animation: floatCircle 25s ease-in-out infinite reverse;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #10B981, transparent 70%);
    top: 50%;
    left: 60%;
    animation: floatCircle 18s ease-in-out infinite 3s;
}

@keyframes floatCircle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

/* Container */
.cpf-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* Logo */
.cpf-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInDown 0.6s ease-out;
}

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

.cpf-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
}

.cpf-logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

/* Card */
.cpf-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    box-shadow: 
        0 4px 6px -1px rgba(0,0,0,0.05),
        0 20px 40px -8px rgba(59, 130, 246, 0.12),
        0 0 0 1px rgba(255,255,255,0.6) inset;
    animation: cardAppear 0.7s ease-out 0.1s backwards;
}

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

/* Card Header */
.cpf-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.cpf-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #3B82F6;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.2);
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.cpf-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1E293B;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.cpf-subtitle {
    font-size: 0.875rem;
    color: #64748B;
    line-height: 1.5;
}

/* Input Group */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    z-index: 2;
}

.cpf-input {
    width: 100%;
    padding: 14px 48px 14px 46px;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    font-size: 1.125rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #1E293B;
    background: #F8FAFC;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.05em;
}

.cpf-input::placeholder {
    color: #CBD5E1;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.cpf-input:focus {
    border-color: #3B82F6;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.cpf-input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: #3B82F6;
}

/* Input Valid State */
.input-group.valid .cpf-input {
    border-color: #10B981;
    background: #FFFFFF;
}

.input-group.valid .input-icon {
    color: #10B981;
}

.input-check {
    position: absolute;
    right: 14px;
    color: #10B981;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-group.valid .input-check {
    opacity: 1;
    transform: scale(1);
}

/* Input Error State */
.input-group.error .cpf-input {
    border-color: #EF4444;
    background: #FEF2F2;
}

.input-group.error .input-icon {
    color: #EF4444;
}

.input-error {
    display: block;
    font-size: 0.75rem;
    color: #EF4444;
    margin-top: 8px;
    font-weight: 500;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.25s;
}

.input-group.error .input-error {
    opacity: 1;
    height: auto;
}

/* Submit Button */
.btn-consult {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #FFFFFF;
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-consult:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.5);
}

.btn-consult:not(:disabled):active {
    transform: translateY(0);
}

.btn-consult:disabled {
    background: linear-gradient(135deg, #CBD5E1, #94A3B8);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

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

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-consult.loading .btn-text {
    display: none;
}

.btn-consult.loading .btn-loading {
    display: inline-flex;
}

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

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

/* Info */
.cpf-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
    font-size: 0.75rem;
    color: #94A3B8;
}

.cpf-info svg {
    flex-shrink: 0;
}

/* Footer */
.cpf-footer {
    font-size: 0.75rem;
    color: #94A3B8;
    animation: fadeInDown 0.8s ease-out 0.3s backwards;
}

/* Error Modal */
.error-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.error-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.error-modal {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 40px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px -8px rgba(0,0,0,0.15);
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.error-modal-overlay.active .error-modal {
    transform: translateY(0) scale(1);
}

.error-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #EF4444;
}

.error-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 8px;
}

.error-modal-text {
    font-size: 0.875rem;
    color: #64748B;
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-error-close {
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.3);
}

.btn-error-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(59, 130, 246, 0.4);
}

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

    .cpf-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .cpf-title {
        font-size: 1.25rem;
    }

    .cpf-input {
        font-size: 1rem;
        padding: 12px 44px 12px 42px;
    }

    .btn-consult {
        padding: 14px;
    }
}
