/**
 * ReefManager - Neuer Lizenzierungsprozess Vorschalt-Dialog Styles
 * 
 * Cyber-Glassmorphism UI passend zum Design-System von ReefManager:
 * - Dunkler, transluzenter Hintergrund mit Backdrop-Filter
 * - Cyan-Akzente (#00e5ff) & Warn-Highlights (#f59e0b)
 * - Responsiv, barrierearm und mit flüssigen CSS-Transitions
 */

:root {
    color-scheme: dark;
}

/* =============================================================================
   1. OVERLAY & CONTAINER
   ============================================================================= */

.rm-license-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(2, 4, 10, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.rm-license-overlay.rm-open {
    opacity: 1;
    visibility: visible;
}

.rm-license-modal {
    background: rgba(6, 11, 22, 0.94);
    border: 1.5px solid rgba(0, 229, 255, 0.45);
    border-radius: 20px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 255, 0.15);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.94) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #f8fafc;
    box-sizing: border-box;
    position: relative;
}

.rm-license-overlay.rm-open .rm-license-modal {
    transform: scale(1) translateY(0);
}

/* Kompaktes Bestätigungs-Modal (Modal 2 - AGB & DIY Bestätigung) */
.rm-license-modal-summary {
    max-width: 620px;
    border-color: rgba(255, 255, 255, 0.4);
}

/* =============================================================================
   2. HEADER
   ============================================================================= */

.rm-license-header {
    padding: 1.4rem 1.6rem 1.1rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-shrink: 0;
}

.rm-license-header-text {
    flex: 1;
}

.rm-license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 50px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    margin-bottom: 0.45rem;
}

.rm-license-badge.rm-badge-cyan {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border-color: rgba(0, 229, 255, 0.45);
}

.rm-license-title {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.rm-license-subtitle {
    color: #94a3b8;
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.4;
}

.rm-license-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rm-license-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
    transform: scale(1.05);
}

/* =============================================================================
   3. MODAL BODY (SCROLLBAR & CONTENT)
   ============================================================================= */

.rm-license-body {
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #cbd5e1;
}

/* Schmale, dezente Scrollbar */
.rm-license-body::-webkit-scrollbar {
    width: 6px;
}

.rm-license-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.rm-license-body::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    border-radius: 10px;
}

.rm-license-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.6);
}

/* Warn-Banner (Keine Vorabzahlung per PayPal) */
.rm-license-alert-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1.5px solid rgba(245, 158, 11, 0.6);
    border-left: 5px solid #f59e0b;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.4rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rm-license-alert-banner i {
    font-size: 1.3rem;
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

.rm-license-alert-title {
    color: #fef08a;
    font-weight: 800;
    font-size: 0.95rem;
    margin: 0 0 0.3rem 0;
}

.rm-license-alert-text {
    color: #fde68a;
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.5;
}

/* Feature & Fakten Grid */
.rm-license-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}

.rm-license-feature-card {
    background: rgba(2, 4, 8, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.95rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.rm-license-feature-card:hover {
    border-color: rgba(0, 229, 255, 0.5);
    background: rgba(4, 10, 20, 0.7);
}

.rm-license-feature-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9rem;
}

.rm-license-feature-header i {
    color: #00e5ff;
    font-size: 0.95rem;
}

.rm-license-feature-card p {
    margin: 0;
    font-size: 0.84rem;
    color: #94a3b8;
    line-height: 1.45;
}

/* Ablauf-Schritte */
.rm-license-steps-wrapper {
    background: rgba(2, 4, 8, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.4rem;
}

.rm-license-section-heading {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 0.9rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-license-step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0.85rem;
}

.rm-license-step-row:last-child {
    margin-bottom: 0;
}

.rm-license-step-badge {
    background: #00e5ff;
    color: #020408;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.rm-license-step-text {
    flex: 1;
    font-size: 0.87rem;
    line-height: 1.45;
}

.rm-license-step-text strong {
    color: #ffffff;
}

.rm-license-data-tag {
    display: inline-block;
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    margin-top: 3px;
}

/* Auffälliger Warnhinweis für PayPal-Zahlungsaufforderung im Webinterface & App */
.rm-license-paypal-warning-badge {
    margin-top: 8px;
    padding: 9px 12px;
    background: rgba(239, 68, 68, 0.16);
    border: 1.5px solid rgba(239, 68, 68, 0.55);
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    color: #fecaca;
    font-size: 0.84rem;
    line-height: 1.5;
}

.rm-license-paypal-warning-badge strong {
    color: #ffffff;
}

.rm-license-paypal-warning-badge .warning-tag {
    display: inline-block;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

/* Checkbox-Bestätigung */
/* Checkbox-Bestätigung */
.rm-license-confirm-box {
    background: rgba(0, 229, 255, 0.06);
    border: 1.5px solid rgba(0, 229, 255, 0.4);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-top: 0.8rem;
    transition: all 0.2s ease;
}

.rm-license-confirm-box:hover {
    border-color: rgba(0, 229, 255, 0.65);
    background: rgba(0, 229, 255, 0.1);
}

.rm-license-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    cursor: pointer;
    user-select: none;
    color: #e2e8f0;
    font-size: 0.89rem;
    line-height: 1.55;
    position: relative;
}

/* Nativer Checkbox-Input ausgeblendet */
.rm-license-native-cb {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    margin: 0;
}

/* Leuchtende Custom Checkbox Box */
.rm-license-custom-cb {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(0, 229, 255, 0.8);
    border-radius: 6px;
    background: rgba(2, 6, 14, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
    cursor: pointer;
    box-sizing: border-box;
}

.rm-license-custom-cb i {
    color: #020408;
    font-size: 13px;
    font-weight: 900;
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Angehakter Zustand: Leuchtend intensiv Cyan-Blau (#00e5ff) */
.rm-license-native-cb:checked + .rm-license-custom-cb {
    background: #00e5ff !important;
    border-color: #00e5ff !important;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.9), 0 0 30px rgba(0, 229, 255, 0.5) !important;
}

.rm-license-native-cb:checked + .rm-license-custom-cb i {
    opacity: 1 !important;
    transform: scale(1) !important;
    color: #020408 !important;
}

.rm-license-checkbox-label:hover .rm-license-custom-cb {
    border-color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.rm-license-cb-text {
    flex: 1;
}

.rm-license-cb-text strong {
    color: #ffffff;
}

/* Textarea für Auto-Paste der kopierten Gerätedaten */
.rm-license-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.65rem 0.9rem;
    background: rgba(2, 4, 8, 0.75);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 10px;
    color: #00e5ff;
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    outline: none;
    box-sizing: border-box;
    resize: vertical;
    transition: all 0.2s ease;
}

.rm-license-textarea:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
    background: rgba(4, 8, 16, 0.9);
}

.rm-license-textarea::placeholder {
    color: #64748b;
    font-family: inherit;
}

/* =============================================================================
   4. MODAL FOOTER & BUTTONS
   ============================================================================= */

.rm-license-footer {
    padding: 1.1rem 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(2, 4, 8, 0.85);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rm-license-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #cbd5e1;
    padding: 0.75rem 1.4rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rm-license-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: #ffffff;
}

.rm-license-btn-cyan-outline {
    background: rgba(0, 229, 255, 0.08);
    border: 1.5px solid rgba(0, 229, 255, 0.45);
    color: #00e5ff;
    padding: 0.75rem 1.4rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.rm-license-btn-cyan-outline:hover {
    background: rgba(0, 229, 255, 0.22);
    border-color: #00e5ff;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
    transform: translateY(-1px);
}

.rm-license-badge.rm-badge-green {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.45);
}

/* =============================================================================
   7. FORMULAR-STILE FÜR RECHNUNGS- & LIZENZDATEN (MODAL 3)
   ============================================================================= */

.rm-license-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 1rem;
}

.rm-license-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rm-license-form-group.full-width {
    grid-column: span 2;
}

.rm-license-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rm-license-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(2, 4, 8, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.rm-license-select {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 0.9rem;
    background: rgba(2, 4, 8, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2300e5ff' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    color-scheme: dark !important;
}

.rm-license-input:focus,
.rm-license-select:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
    background-color: rgba(4, 8, 16, 0.95);
}

/* Dunkle Stile für aufgeklappte Dropdown-Optionen (Gerätetyp) */
.rm-license-select optgroup {
    background-color: #03060d !important;
    color: #00e5ff !important;
    font-weight: 700 !important;
    padding: 8px 10px !important;
}

.rm-license-select option {
    background-color: #060b16 !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
    font-size: 0.88rem;
}

.rm-license-select option:hover,
.rm-license-select option:focus,
.rm-license-select option:checked {
    background-color: #0b1528 !important;
    color: #00e5ff !important;
}

.rm-license-input::placeholder {
    color: #64748b;
}

.rm-license-btn-primary {
    background: #00e5ff;
    border: 1px solid #00e5ff;
    color: #020408;
    padding: 0.75rem 1.6rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
}

.rm-license-btn-primary:hover:not(:disabled) {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.rm-license-btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* =============================================================================
   5. MODAL 2 (AGB- & DIY-BESTÄTIGUNG VOR DEM FLASHEN)
   ============================================================================= */

/* Button-Zustände für startFlashBtn */
#startFlashBtn:disabled {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    box-shadow: none !important;
}

#startFlashBtn:not(:disabled) {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    opacity: 1 !important;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.45) !important;
    transition: all 0.2s ease !important;
}

#startFlashBtn:not(:disabled):hover {
    background: #0369a1 !important;
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(2, 132, 199, 0.65) !important;
}

#cancelFlashBtn {
    transition: all 0.2s ease;
}

#cancelFlashBtn:hover {
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.rm-summary-list {
    list-style: none;
    margin: 0 0 1.2rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rm-summary-item {
    background: rgba(2, 4, 8, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.rm-summary-icon.icon-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.rm-summary-icon.icon-cyan {
    background: rgba(0, 229, 255, 0.18);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.4);
}

.rm-summary-icon.icon-success {
    background: rgba(34, 197, 94, 0.18);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.rm-summary-icon.icon-amber {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.rm-summary-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #e2e8f0;
}

.rm-summary-text strong {
    color: #ffffff;
    display: block;
    margin-bottom: 2px;
}

/* =============================================================================
   6. RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 640px) {
    .rm-license-modal {
        max-height: 94vh;
        border-radius: 16px;
    }

    .rm-license-header {
        padding: 1.1rem 1.2rem;
    }

    .rm-license-body {
        padding: 1.1rem 1.2rem;
    }

    .rm-license-footer {
        padding: 0.9rem 1.2rem;
        flex-direction: column-reverse;
        width: 100%;
    }

    .rm-license-footer button {
        width: 100%;
        justify-content: center;
    }

    .rm-license-features-grid {
        grid-template-columns: 1fr;
    }
}
