/* Estilos globais modernos para Pay2m App */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --border: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

tr:hover {
    background: #f8f9fa;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--info);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Code */
.code-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    border: 1px solid var(--border);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .card {
        padding: 1.5rem;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }
}

/* QR Code Container */
#qrcode {
    margin: 2rem auto;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

#qrcodeContainer {
    position: relative;
    display: inline-block;
}

/* Overlay de confirmação de pagamento */
.payment-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.95);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
}

.payment-success-overlay .check-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.payment-success-overlay .check-icon svg {
    width: 70px;
    height: 70px;
    display: block;
}

.payment-success-overlay .check-icon svg path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.8s ease-in-out 0.3s forwards;
}

.payment-success-overlay h3 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    animation: slideUp 0.5s ease-in-out 0.5s both;
}

.payment-success-overlay p {
    color: white;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    animation: slideUp 0.5s ease-in-out 0.7s both;
}

/* Check Icon - Success */
.check-icon-static {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: pulseSuccess 2s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.check-icon-static svg {
    width: 90px;
    height: 90px;
    display: block;
}

@keyframes pulseSuccess {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(40, 167, 69, 0);
    }
}

/* Expired Icon */
.expired-icon {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.3);
}

.expired-icon svg {
    width: 90px;
    height: 90px;
    display: block;
}

/* Canceled Icon */
.canceled-icon {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 24px rgba(108, 117, 125, 0.3);
}

.canceled-icon svg {
    width: 90px;
    height: 90px;
    display: block;
}

/* Info Row */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.info-label {
    font-weight: 600;
    color: var(--secondary);
}

.info-value {
    text-align: right;
    word-break: break-word;
}

/* Payment Info Box */
.payment-info-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light);
    border-radius: 8px;
    display: inline-block;
}

.payment-info-box p {
    margin: 0;
    color: #666;
}

.payment-info-box p+p {
    margin-top: 1rem;
}

/* Status Section */
.status-section {
    margin: 2rem 0 0 0;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    text-align: center;
}

.status-section h3 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Payment Status - Confirmed */
.payment-confirmed {
    text-align: center;
    padding: 3rem 1rem;
}

.payment-confirmed .success-title {
    color: var(--success);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.payment-confirmed p {
    color: #666;
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.6;
}

/* Payment Status - Expired */
.payment-expired {
    text-align: center;
    padding: 3rem 1rem;
}

.payment-expired .expired-title {
    color: var(--danger);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.payment-expired p {
    color: #666;
    font-size: 1.15rem;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

/* Payment Status - Canceled */
.payment-canceled {
    text-align: center;
    padding: 3rem 1rem;
}

.payment-canceled .canceled-title {
    color: var(--secondary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.payment-canceled p {
    color: #666;
    font-size: 1.15rem;
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

/* PIX Actions */
.pix-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.pix-actions h3 {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

#autoCheckStatus {
    margin-top: 1.5rem;
}

.auto-check-info {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/*
 Info Boxes - Padronização de Mensagens */
.info-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.8;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #0d47a1;
}

.info-box a {
    color: #1976d2;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.info-box a:hover {
    border-bottom-color: #1976d2;
}

.info-box ol, .info-box ul {
    margin: 8px 0 0 0;
    padding-left: 0;
    list-style-position: inside;
}

.info-box li {
    margin: 4px 0;
}

/* Variações de Info Box */
.info-box.info-success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.info-box.info-success strong {
    color: #1b5e20;
}

.info-box.info-success a {
    color: #388e3c;
}

.info-box.info-warning {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #e65100;
}

.info-box.info-warning strong {
    color: #bf360c;
}

.info-box.info-warning a {
    color: #f57c00;
}

.info-box.info-error {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.info-box.info-error strong {
    color: #b71c1c;
}

.info-box.info-error a {
    color: #d32f2f;
}


/* Alerts - Mensagens de Feedback */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert strong {
    font-weight: 600;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: #4caf50;
    color: #2e7d32;
}

.alert-error {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-left-color: #2196f3;
    color: #1565c0;
}
