/* Invoice Modal Styles */

.invoice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.invoice-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.invoice-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    animation: invoiceModalSlideIn 0.3s ease-out;
}

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

.invoice-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.invoice-modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.invoice-step h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.invoice-subtitle {
    margin: 0 0 32px 0;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.invoice-personal-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.invoice-personal-section h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

#personal-address-fields {
    display: none;
}

/* Choice buttons */
.invoice-choice-buttons {
    display: flex;
    gap: 16px;
    flex-direction: column;
}

.invoice-choice-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.invoice-choice-buttons .btn .icon {
    font-size: 24px;
}

.invoice-choice-buttons .btn-primary {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.invoice-choice-buttons .btn-primary:hover {
    background: #45a049;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.invoice-choice-buttons .btn-secondary {
    background: white;
    color: #333;
    border-color: #ddd;
}

.invoice-choice-buttons .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #bbb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Form styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label .icon {
    margin-right: 6px;
}

.form-group label .required {
    color: #e74c3c;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3E1725;
    box-shadow: 0 0 0 3px rgba(61, 24, 37, 0.12);
}

.form-control::placeholder {
    color: #aaa;
}

.form-control:invalid {
    border-color: #e1e8ed;
}

.form-control:invalid:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #777;
    font-style: italic;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3E1725;
}

.form-checkbox span {
    flex: 1;
}

.invoice-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e8ed;
}

.invoice-form-actions .btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoice-form-actions .btn-primary {
    background: #3E1725;
    color: white;
    border-color: #3E1725;
}

.invoice-form-actions .btn-primary:hover {
    background: #5D2D3F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 24, 37, 0.28);
}

.invoice-form-actions .btn-secondary {
    background: #f8f9fa;
    color: #666;
    border-color: #ddd;
}

.invoice-form-actions .btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

/* Loading state */
.invoice-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3E1725;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.invoice-loading h3 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
}

.invoice-loading p {
    margin: 0;
    font-size: 15px;
    color: #777;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .invoice-modal-content {
        padding: 24px;
        max-height: 95vh;
    }
    
    .invoice-step h2 {
        font-size: 24px;
    }
    
    .invoice-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .invoice-choice-buttons {
        gap: 12px;
    }
    
    .invoice-choice-buttons .btn {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .invoice-form-actions {
        flex-direction: column-reverse;
    }
    
    .invoice-form-actions .btn {
        width: 100%;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .invoice-modal {
        padding: 0;
    }
    
    .invoice-modal-content {
        border-radius: 0;
        max-height: 100vh;
        padding: 20px;
    }
    
    .invoice-step h2 {
        font-size: 20px;
    }
}

.is-hidden {
    display: none;
}

.instructor-email {
    font-size: 0.8rem;
    color: #3E1725;
}

.course-access-message {
    color: #3E1725;
    font-weight: 700;
    line-height: 1.6;
}

.course-back-link-btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: #3E1725;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.membership-gate-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 20px;
}

.membership-gate-dialog {
    background: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.membership-gate-icon-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.membership-gate-icon {
    font-size: 48px;
    color: #3E1725;
}

.membership-gate-title {
    margin: 0 0 12px;
    color: #3E1725;
    text-align: center;
    font-size: 1.5rem;
}

.membership-gate-text {
    color: #555;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 24px;
}

.membership-gate-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.membership-gate-cancel,
.membership-gate-link {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
}

.membership-gate-cancel {
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.membership-gate-link {
    background: #3E1725;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}

.event-registration-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.event-registration-modal-backdrop.active {
    display: flex;
}

.event-registration-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.event-registration-modal header {
    padding: 1rem 1.5rem;
    background: #3E1725;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.event-registration-modal .modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}

.event-registration-modal .modal-body {
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.event-registration-modal .modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.event-registration-modal .modal-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 8px;
}

.event-registration-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c1a5b0;
    border-radius: 8px;
}

.event-registration-modal .modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #eee;
}

.modal-event-title {
    margin-bottom: 0.5rem;
    color: #3E1725;
    font-weight: 900;
}

.modal-event-meta {
    display: grid;
    gap: 0.5rem;
    color: #444;
    font-weight: 700;
}

.modal-event-label {
    color: #666;
    font-weight: 700;
}

.modal-event-note {
    margin-top: 1rem;
    color: #666;
    line-height: 1.5;
}

/* Document overlays (receipt/invoice) */
.doc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.doc-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

.doc-card--processing {
    max-width: 500px;
    padding: 40px;
}

.doc-card--result {
    max-width: 600px;
    padding: 48px;
    position: relative;
}

.doc-icon {
    background: linear-gradient(135deg, #3E1725 0%, #5D2D3F 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(61, 24, 37, 0.3);
}

.doc-icon--small {
    width: 80px;
    height: 80px;
    font-size: 40px;
}

.doc-icon--lg {
    width: 100px;
    height: 100px;
    font-size: 50px;
    margin-bottom: 28px;
}

.doc-title {
    margin: 0 0 16px;
    font-size: 32px;
    font-weight: 800;
    color: #3E1725;
    font-family: var(--font-heading);
}

.doc-title--md {
    margin-bottom: 12px;
    font-size: 28px;
}

.doc-text {
    margin: 0 0 32px;
    color: #666;
    font-size: 18px;
    line-height: 1.6;
}

.doc-text--md {
    margin-bottom: 24px;
    font-size: 16px;
}

.doc-spinner-emoji {
    display: inline-block;
    margin-top: 8px;
    font-size: 24px;
}

.doc-dots {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.doc-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3E1725;
    animation: pulse 1.5s infinite;
}

.doc-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.doc-dots .dot:nth-child(3) { animation-delay: 0.4s; }

.doc-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.doc-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    padding: 14px 28px;
}

.doc-note {
    margin: 32px 0 0;
    color: #999;
    font-size: 14px;
}

.doc-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f0f0f0;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.doc-close-btn:hover {
    background: #e6e6e6;
}

.doc-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    text-align: center;
}

.doc-loading-text {
    font-size: 14px;
    color: #666;
}

.doc-loading-icon {
    font-size: 24px;
    color: #3E1725;
    margin-bottom: 12px;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}
