/* Digitala Huset - Registrations Styles */

/* Kompakt anmälningssektion */
.dh-registration-compact {
    margin: 15px 0;
}

.dh-registration-summary {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: var(--dh-bg-light);
    border-radius: var(--dh-border-radius);
    border: 1px solid var(--dh-border-color);
}

.dh-spots-summary {
    text-align: center;
}

.dh-spots-text {
    font-weight: 600;
    color: var(--dh-text-dark);
    font-size: 14px;
}

.dh-spots-available {
    color: var(--dh-secondary-color);
    font-size: 13px;
    margin-left: 5px;
}

.dh-deadline-compact {
    margin-top: 8px;
    text-align: center;
}

.dh-deadline-compact small {
    color: var(--dh-text-light);
    font-size: 12px;
}

.dh-btn-open-registration {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 14px;
    padding: 10px 15px;
}

/* Modal styles */
.dh-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
}

.dh-modal[style*="display: block"],
.dh-modal[style*="display:block"] {
    display: block !important;
}

.dh-modal-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.dh-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
}

.dh-modal-large {
    max-width: 600px;
}

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

.dh-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.dh-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

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

.dh-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.dh-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.dh-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Ursprunglig container stil för bakåtkompatibilitet */
.dh-registration-container {
    background: var(--dh-bg-white);
    border-radius: var(--dh-border-radius);
    padding: 25px;
    margin: 20px 0;
    box-shadow: var(--dh-shadow-sm);
    border: 1px solid var(--dh-border-color);
}

/* Registration Status */
.dh-registration-status {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--dh-bg-light);
    border-radius: 6px;
}

.dh-spots-info {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.dh-spots-current {
    color: var(--dh-primary-color);
    font-size: 18px;
    font-weight: 700;
}

.dh-spots-separator {
    color: var(--dh-text-light);
}

.dh-spots-max {
    color: var(--dh-text-dark);
    font-size: 18px;
}

.dh-spots-label {
    color: var(--dh-text-light);
    font-size: 14px;
    font-weight: 500;
}

.dh-spots-remaining {
    color: var(--dh-secondary-color);
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
}

/* Progress Bar */
.dh-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.dh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dh-secondary-color), var(--dh-primary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Deadline Info */
.dh-deadline-info {
    margin: 15px 0;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

/* Cancellation Info */
.dh-cancellation-info {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    border-left: 4px solid var(--dh-secondary-color);
}

.dh-cancellation-info p {
    margin: 0 0 10px 0;
    color: var(--dh-text-dark);
}

.dh-cancellation-info p:last-child {
    margin-bottom: 0;
}

/* Form Styles */
.dh-registration-form {
    background: var(--dh-bg-white);
    border-radius: 6px;
    padding: 20px;
    border: 1px solid var(--dh-border-color);
}

.dh-registration-form h4 {
    margin: 0 0 20px 0;
    color: var(--dh-text-dark);
    font-size: 18px;
    font-weight: 600;
}

.dh-form-row {
    margin-bottom: 20px;
}

.dh-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dh-text-dark);
}

.dh-form-row label small {
    font-weight: 400;
    color: var(--dh-text-light);
}

.dh-form-input {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    border: 2px solid var(--dh-border-color) !important;
    border-radius: var(--dh-border-radius) !important;
    background: var(--dh-bg-white) !important;
    transition: var(--dh-transition) !important;
    box-sizing: border-box !important;
}

.dh-form-input:focus {
    outline: none !important;
    border-color: var(--dh-primary-color) !important;
    box-shadow: 0 0 0 3px rgba(27, 54, 95, 0.1) !important;
}

.dh-form-input:invalid {
    border-color: #dc3545 !important;
}

.dh-form-row.has-error .dh-form-input {
    border-color: #dc3545 !important;
}

.field-error {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

/* Checkbox Styles */
.dh-consent-row,
.dh-email-consent-row {
    margin: 25px 0;
}

.dh-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400 !important;
    line-height: 1.5;
}

.dh-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid var(--dh-border-color) !important;
    border-radius: 4px !important;
    background: var(--dh-bg-white) !important;
    position: relative;
    cursor: pointer;
    margin: 0 !important;
    flex-shrink: 0;
}

.dh-checkbox:checked {
    background: var(--dh-primary-color) !important;
    border-color: var(--dh-primary-color) !important;
}

.dh-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.dh-checkbox:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(27, 54, 95, 0.2) !important;
}

/* Form Actions */
.dh-form-actions {
    margin-top: 25px;
    text-align: center;
}

.dh-btn-register {
    min-width: 160px;
    position: relative;
}

.dh-btn-loading {
    display: none !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner */
.dh-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form Result */
.dh-form-result,
.dh-cancellation-result,
.dh-check-result {
    margin-top: 15px;
}

/* Notices */
.dh-registration-notice {
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid;
}

.dh-registration-notice p {
    margin: 0 0 10px 0;
}

.dh-registration-notice p:last-child {
    margin-bottom: 0;
}

.dh-notice-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.dh-notice-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.dh-notice-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.dh-notice-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.dh-notice-neutral {
    background: var(--dh-bg-light);
    border-color: var(--dh-border-color);
    color: var(--dh-text-dark);
}

/* Cancellation Form */
.dh-cancellation-form {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.dh-cancellation-form h4 {
    margin: 0 0 15px 0;
    color: #c53030;
}

.dh-cancellation-form .dh-form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Button Variants */
.dh-btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.dh-btn-danger:hover {
    background: #c82333;
}

.dh-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dh-registration-container {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .dh-registration-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }
    
    .dh-btn-open-registration {
        width: 100%;
        justify-content: center;
    }
    
    .dh-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .dh-modal-header {
        padding: 16px 20px 12px;
    }
    
    .dh-modal-body {
        padding: 16px 20px;
    }
    
    .dh-modal-footer {
        padding: 12px 20px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .dh-modal-footer .dh-btn {
        width: 100%;
        margin-bottom: 0;
    }
    
    .dh-spots-info {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .dh-spots-remaining {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .dh-cancellation-form .dh-form-actions {
        flex-direction: column;
    }
    
    .dh-checkbox-label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .dh-registration-container {
        padding: 15px 10px;
    }
    
    .dh-registration-form {
        padding: 15px;
    }
    
    .dh-form-input {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    
    .dh-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dh-cancellation-form .dh-form-actions .dh-btn {
        margin-bottom: 5px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .dh-registration-container {
        border: 2px solid var(--dh-text-dark);
    }
    
    .dh-form-input {
        border: 2px solid var(--dh-text-dark) !important;
    }
    
    .dh-checkbox {
        border: 2px solid var(--dh-text-dark) !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .dh-progress-fill,
    .dh-form-input,
    .dh-checkbox,
    .dh-spinner {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus Indicators for Accessibility */
.dh-registration-container *:focus {
    outline: 2px solid var(--dh-primary-color);
    outline-offset: 2px;
}

.dh-checkbox:focus {
    outline: 2px solid var(--dh-primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .dh-registration-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .dh-btn {
        display: none;
    }
    
    .dh-form-input {
        border: 1px solid #000 !important;
    }
}