:root {
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --primary-gradient-hover: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --sbp-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --sbp-gradient-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 40px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 48px;
    object-fit: contain;
}

.sbp-logo-img {
    height: 38px;
    object-fit: contain;
    filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

/* Card layout */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.4);
}

h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

label .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.input-control {
    width: 100%;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-sans);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

.input-error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.error-text {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
    display: none;
}

/* Instructions */
.info-note {
    background: rgba(30, 41, 59, 0.4);
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--text-secondary);
}

.info-note p {
    margin-bottom: 8px;
}

.info-note p:last-child {
    margin-bottom: 0;
}

.info-note strong {
    color: var(--text-primary);
}

/* Toggle option */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Actions Section */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-sbp {
    background: var(--sbp-gradient);
    color: #ffffff;
}

.btn-sbp:hover {
    background: var(--sbp-gradient-hover);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.btn-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-card .warning-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.25);
    margin-left: auto;
}

.btn-card-disabled {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.2) !important;
    cursor: not-allowed !important;
}

.btn-card-disabled .warning-badge {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger-color) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

/* QR Code Section */
.qr-result {
    text-align: center;
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.qr-result h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.qr-image-wrapper {
    background: #ffffff;
    padding: 15px;
    border-radius: var(--radius-lg);
    display: inline-block;
    box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
}

.qr-image-wrapper img {
    display: block;
    width: 220px;
    height: 220px;
}

.qr-instructions {
    max-width: 400px;
    margin: 0 auto 30px auto;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--card-border);
}

.qr-instructions ol {
    padding-left: 20px;
    color: var(--text-secondary);
}

.qr-instructions li {
    margin-bottom: 8px;
}

.qr-instructions li:last-child {
    margin-bottom: 0;
}

.qr-link-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    margin-bottom: 15px;
}

.qr-link-btn:hover {
    background: var(--primary-gradient-hover);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

/* Modal and Overlays */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.custom-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.custom-modal.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.modal-body {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 14px;
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.modal-actions .btn {
    padding: 10px 16px;
    font-size: 14px;
}

/* Loading overlay / spinner */
.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px 0;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--card-border);
    margin-top: 50px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Hide helper */
.hide {
    display: none !important;
}

/* Checkbox error highlight */
input[type="checkbox"].input-error {
    outline: 2px solid var(--danger-color) !important;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 0 10px 0;
    }
    
    .card {
        padding: 20px;
    }
}

@media (max-width: 325px) {
    .btn svg {
        display: none !important;
    }
}
