/**
 * BankID Public Styles
 */

/* Admin Allowlist Styles */
.bankid-status-approved {
    color: #46b450;
    font-weight: 600;
}

.bankid-status-pending {
    color: #f0ad4e;
    font-weight: 600;
}

.bankid-status-blocked {
    color: #dc3232;
    font-weight: 600;
}

/* Highlight effect for required fields */
.bankid-highlight {
    border-color: #2196f3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2) !important;
    animation: bankid-pulse 1s ease-in-out;
}

@keyframes bankid-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Button styles */
.bankid-button,
.bankid-sign-btn {
    background-color: #003247;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
}

.bankid-button:hover,
.bankid-sign-btn:hover {
    background-color: #00496b;
}

.bankid-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Sizes */
.bankid-button-small {
    padding: 8px 16px;
    font-size: 14px;
}

.bankid-button-small .bankid-logo {
    height: 16px;
}

.bankid-button-medium {
    padding: 12px 24px;
    font-size: 16px;
}

.bankid-button-large {
    padding: 16px 32px;
    font-size: 18px;
}

.bankid-button-large .bankid-logo {
    height: 24px;
}

/* Button Styles */
.bankid-style-default {
    background-color: #003247;
    color: white;
}

.bankid-style-default:hover {
    background-color: #00496b;
}

.bankid-style-minimal {
    background-color: transparent;
    color: #003247;
    border: 2px solid #003247;
}

.bankid-style-minimal:hover {
    background-color: #003247;
    color: white;
}

.bankid-style-custom {
    /* User can override with their own CSS */
}

.bankid-logo {
    height: 20px;
    width: auto;
}

/* Container styles */
.bankid-verify-container,
.bankid-auth-container,
.bankid-checkout-verify {
    margin: 20px 0;
}

/* QR Modal Container */
.bankid-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bankid-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bankid-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.bankid-modal-overlay.active .bankid-modal {
    transform: scale(1);
}

/* Modal Header */
.bankid-modal-header {
    background: #f8f9fa;
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 16px 16px 0 0;
}

.bankid-modal-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bankid-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.bankid-modal-title img {
    height: 32px;
    width: auto;
}

.bankid-modal-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #003247;
}

.bankid-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.bankid-modal-close:hover {
    background-color: #e9ecef;
}

/* Modal Body */
.bankid-modal-body {
    padding: 32px;
    text-align: center;
}

/* QR Code Container */
.bankid-qr-wrapper {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.bankid-qr-code {
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto;
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Status Messages */
.bankid-status {
    text-align: center;
    padding: 0;
}

.bankid-status-message {
    font-size: 16px;
    color: #495057;
    margin: 16px 0;
    line-height: 1.5;
}

/* Instructions */
.bankid-instructions {
    background: #e7f3ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.bankid-instructions h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #003247;
}

.bankid-instructions ol {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: #495057;
}

.bankid-instructions li {
    margin-bottom: 6px;
}

/* Device selector */
.bankid-device-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.bankid-device-option {
    flex: 1;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.bankid-device-option:hover {
    border-color: #0073aa;
}

.bankid-device-option.active {
    border-color: #003247;
    background: #f8f9fa;
}

.bankid-device-option i {
    font-size: 24px;
    color: #003247;
    display: block;
    margin-bottom: 8px;
}

.bankid-device-option span {
    font-size: 14px;
    color: #495057;
}

/* Form styles */
.bankid-auth-form {
    max-width: 400px;
}

.bankid-form-group {
    margin-bottom: 15px;
}

.bankid-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.bankid-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Success styles */
.bankid-success {
    text-align: center;
    padding: 20px;
}

.bankid-success-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 16px;
}

.bankid-success-title {
    font-size: 24px;
    font-weight: 600;
    color: #003247;
    margin: 0 0 8px 0;
}

.bankid-success-name {
    font-size: 18px;
    color: #495057;
    margin: 0;
}

.bankid-redirect-message {
    font-size: 14px;
    color: #666;
    margin-top: 16px;
    font-style: italic;
}

/* Signing text in modal */
.bankid-sign-text-modal {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}

.bankid-sign-text-modal strong {
    display: block;
    margin-bottom: 8px;
    color: #003247;
}

.bankid-sign-text-modal blockquote {
    margin: 0;
    padding: 12px;
    background: white;
    border-left: 4px solid #003247;
    font-style: italic;
    color: #495057;
}

/* Email field for signing */
.bankid-email-field {
    margin: 20px 0;
}

.bankid-email-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.bankid-sign-email {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.bankid-sign-email.error {
    border-color: #dc3545;
}

.bankid-field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* Sign text display */
.bankid-sign-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.bankid-sign-text blockquote {
    margin: 10px 0 0 0;
    padding: 10px;
    background: white;
    border-left: 4px solid #003247;
    font-style: italic;
}

.bankid-success-name {
    font-size: 18px;
    color: #495057;
    margin: 0;
}

/* Error styles */
.bankid-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

/* Checkout styles */
.bankid-checkout-verify {
    border: 1px solid #ddd;
    padding: 15px;
    margin: 15px 0;
    background: #f9f9f9;
}

.bankid-checkout-status {
    margin-top: 15px;
}

.bankid-age-notice {
    color: #666;
    font-size: 14px;
}

/* Admin styles */
.bankid-allowlist-stats {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.stat-box {
    background: white;
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    flex: 1;
}

.stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #0073aa;
    margin: 0;
}

.bankid-status-approved {
    color: #090;
}

.bankid-status-pending {
    color: #f90;
}

.bankid-status-blocked {
    color: #d00;
}

/* Trust indicators */
.bankid-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    margin-top: 16px;
    justify-content: center;
}

.bankid-security-note i {
    color: #28a745;
}

/* Mobile app launch */
.bankid-mobile-app-launch,
.bankid-desktop-app-launch {
    text-align: center;
    margin-bottom: 20px;
}

.bankid-open-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #005398;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.bankid-open-app-btn:hover {
    background: #003d73;
    color: white;
    text-decoration: none;
}

.bankid-mobile-help {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .bankid-allowlist-stats {
        flex-wrap: wrap;
    }
    
    .stat-box {
        flex: 1 1 45%;
    }
    
    .bankid-modal {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .bankid-modal-body {
        padding: 24px;
    }
    
    .bankid-qr-code {
        max-width: 100%;
    }
    
    .bankid-device-selector {
        flex-direction: column;
    }
}