/**
 * Estilos do Frontend Público do NotaFiscal Digital.
 */

:root {
    --nfd-primary: #1e3a8a;
    --nfd-primary-hover: #172554;
    --nfd-accent: #059669;
    --nfd-accent-hover: #047857;
    --nfd-dark: #0f172a;
    --nfd-gray-text: #475569;
    --nfd-light-bg: #f8fafc;
    --nfd-border: #e2e8f0;
}

/* BOTÃO DE COMPRA */
.nfd-button-wrapper {
    display: inline-block;
    margin: 12px 0;
}

.nfd-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--nfd-accent);
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.25), 0 2px 4px -2px rgba(5, 150, 105, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.2;
}

.nfd-buy-btn:hover {
    background-color: var(--nfd-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(5, 150, 105, 0.3);
}

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

.nfd-btn-icon {
    font-size: 18px;
}

/* CARD DE PRODUTO */
.nfd-product-card {
    background: #ffffff;
    border: 1px solid var(--nfd-border);
    border-radius: 14px;
    padding: 24px;
    max-width: 420px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.nfd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.nfd-badge-format {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.nfd-badge-info {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.nfd-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nfd-dark);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.nfd-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--nfd-gray-text);
    margin-bottom: 20px;
    flex-grow: 1;
}

.nfd-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.nfd-price-label {
    font-size: 13px;
    color: #64748b;
}

.nfd-card-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--nfd-dark);
}

.nfd-card-btn {
    width: 100%;
}

/* MODAL DE CHECKOUT */
.nfd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.nfd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.nfd-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    overflow: hidden;
    animation: nfdModalIn 0.25s ease-out;
}

@keyframes nfdModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.nfd-modal-content {
    padding: 32px;
}

.nfd-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s;
    padding: 4px;
}

.nfd-modal-close:hover {
    color: #0f172a;
}

.nfd-modal-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.nfd-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nfd-dark);
    margin: 0 0 6px 0;
}

.nfd-modal-subtitle {
    font-size: 13px;
    color: var(--nfd-gray-text);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.nfd-modal-summary {
    background: #f8fafc;
    border: 1px solid var(--nfd-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.nfd-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}

.nfd-summary-item:last-child {
    margin-bottom: 0;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.nfd-summary-label {
    color: #64748b;
}

.nfd-summary-val {
    color: #0f172a;
    font-weight: 600;
}

.nfd-summary-price {
    color: var(--nfd-accent);
    font-size: 16px;
    font-weight: 800;
}

.nfd-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.nfd-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.nfd-form-group input[type="text"],
.nfd-form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.nfd-form-group input:focus {
    border-color: var(--nfd-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.nfd-checkbox-group {
    margin: 16px 0 20px 0;
}

.nfd-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.nfd-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.nfd-optin-text {
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
}

.nfd-submit-button {
    width: 100%;
    background-color: var(--nfd-accent);
    color: #ffffff;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
}

.nfd-submit-button:hover:not(:disabled) {
    background-color: var(--nfd-accent-hover);
}

.nfd-submit-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.nfd-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: nfdSpin 0.8s linear infinite;
}

@keyframes nfdSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nfd-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.nfd-trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    font-size: 11px;
    color: #64748b;
}

@media (max-width: 480px) {
    .nfd-modal-content {
        padding: 24px 20px;
    }
}
