/**
 * BankID Checkout Overlay Styles
 * Seamless age verification overlay for WooCommerce checkout
 */

/* Overlay Container */
.bankid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bankid-fade-in 0.3s ease;
}

@keyframes bankid-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Backdrop */
.bankid-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Content Container */
.bankid-overlay-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bankid-slide-up 0.3s ease;
}

@keyframes bankid-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.bankid-overlay-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bankid-overlay-header img {
    height: 32px;
    width: auto;
}

.bankid-overlay-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.bankid-overlay-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.bankid-overlay-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Body */
.bankid-overlay-body {
    padding: 28px;
}

/* Age Notice */
.bankid-age-notice {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: #f0f9ff;
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.bankid-icon-shield {
    width: 48px;
    height: 48px;
    color: #0284c7;
    margin: 0 auto 16px;
}

.bankid-age-notice p {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.6;
    color: #1e40af;
}

.bankid-age-notice p:last-child {
    margin-bottom: 0;
    font-size: 14px;
    color: #3b82f6;
}

/* Verification Area */
.bankid-verification-area {
    text-align: center;
}

/* Verify Button */
.bankid-verify-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    min-width: 260px;
}

.bankid-verify-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

.bankid-verify-button:active:not(:disabled) {
    transform: translateY(0);
}

.bankid-verify-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bankid-verify-button .bankid-logo {
    height: 24px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* Status Message */
.bankid-status-message {
    margin-top: 24px;
    padding: 16px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.bankid-status-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.bankid-status-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.bankid-status-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.bankid-status-message.loading {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* QR Code Container */
.bankid-qr-container {
    margin-top: 24px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.bankid-qr-container > p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #6b7280;
}

.bankid-qr-code {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto;
}

.bankid-qr-code img,
.bankid-qr-code canvas {
    display: block;
    max-width: 200px;
    height: auto;
}

.bankid-qr-instruction {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 12px;
}

/* Footer */
.bankid-overlay-footer {
    padding: 20px 28px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
}

.bankid-privacy-notice {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
}

/* Loading Spinner */
.bankid-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: bankid-spin 0.8s linear infinite;
}

@keyframes bankid-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .bankid-overlay-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .bankid-overlay-header {
        padding: 20px;
    }

    .bankid-overlay-header h2 {
        font-size: 20px;
    }

    .bankid-overlay-body {
        padding: 20px;
    }

    .bankid-age-notice {
        padding: 20px;
    }

    .bankid-verify-button {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }

    .bankid-qr-container {
        padding: 20px;
    }
}

/* Force light mode for consistent branding */
.bankid-overlay-content {
    color-scheme: light;
}

.bankid-overlay-content * {
    color-scheme: light;
}

/* Accessibility */
.bankid-overlay:focus-within {
    outline: none;
}

.bankid-verify-button:focus,
.bankid-overlay-close:focus {
    outline: 3px solid #60a5fa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bankid-overlay {
        display: none !important;
    }
}

/* Accessible way back to verification after dismissing the dialog. */
#bankid-verification-reminder { position:fixed; bottom:16px; right:16px; left:16px; margin:auto; max-width:600px; padding:14px; background:#fff; color:#111827; border:1px solid #2563eb; border-radius:8px; box-shadow:0 2px 12px #0002; z-index:99998; }
#bankid-verification-reminder button { display:block; margin-top:8px; padding:10px 16px; background:#1d4ed8; color:#fff; border:0; border-radius:6px; cursor:pointer; }
