/**
 * True Love Pagamentos - Estilos Globais
 * Tema Rosa com UI Moderna
 */

/* ============================================================
   CSS VARIABLES (Tema)
   ============================================================ */
:root {
    /* Cores Principais */
    --primary: #EC3E8E;
    --primary-hover: #D92A78;
    --primary-light: #FDECEF;
    --primary-rgb: 236, 62, 142;

    /* Cores de Estado */
    --success: #22C55E;
    --success-light: #DCFCE7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Fundos e Texto */
    --bg: #F9FAFB;
    --card: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* UI */
    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 22px;
    --shadow: 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-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transições */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ============================================================
   RESET E BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg);
}

/* ============================================================
   PLANOS - Cards de Planos
   ============================================================ */
.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.plano-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    position: relative;
    transition: var(--transition-slow);
}

.plano-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.plano-card.destaque {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.plano-card.destaque::before {
    content: 'Mais Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plano-nome {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.plano-preco {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.plano-preco small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.plano-descricao {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    min-height: 60px;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-light);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-label.required::after {
    content: '*';
    color: var(--error);
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-control.error {
    border-color: var(--error);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 6px;
}

/* Input com label flutuante */
.form-floating {
    position: relative;
}

.form-floating .form-control {
    padding-top: 24px;
    padding-bottom: 8px;
}

.form-floating .form-label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
    margin-bottom: 0;
}

.form-floating .form-control:focus ~ .form-label,
.form-floating .form-control:not(:placeholder-shown) ~ .form-label {
    top: 12px;
    font-size: 0.75rem;
    color: var(--primary);
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

/* Grid de formulário */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-slow);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================================
   STEPS (Passos do Checkout)
   ============================================================ */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    margin-bottom: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--border-light);
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 640px) {
    .step-label {
        display: block;
    }
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 500;
}

.step-divider {
    width: 40px;
    height: 2px;
    background: var(--border);
}

.step.completed + .step-divider {
    background: var(--success);
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================================
   PIX
   ============================================================ */
.pix-container {
    text-align: center;
    padding: 20px;
}

.pix-qrcode {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    padding: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.pix-qrcode img {
    width: 100%;
    height: 100%;
}

.pix-code {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pix-copy-btn {
    margin-top: 10px;
}

/* ============================================================
   SUCESSO / RESULTADO
   ============================================================ */
.result-container {
    text-align: center;
    padding: 40px 20px;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.result-icon.error {
    background: var(--error-light);
    color: var(--error);
}

.result-icon svg {
    width: 40px;
    height: 40px;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-message {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ============================================================
   PAGAMENTO - Seleção de método
   ============================================================ */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.payment-method:hover {
    border-color: var(--primary-light);
}

.payment-method.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.payment-method-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.payment-method-name {
    font-weight: 600;
    color: var(--text);
}

/* Parcelas */
.parcelas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.parcela-option {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.parcela-option:hover {
    border-color: var(--primary);
}

.parcela-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.parcela-option input {
    display: none;
}

.parcela-valor {
    font-weight: 600;
    color: var(--text);
}

.parcela-total {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 768px) {
    .planos-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-height: 100vh;
        border-radius: var(--radius);
        margin: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .parcelas-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PAGE SPECIFIC - Página inicial
   ============================================================ */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 100%);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.75rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary);
}
