:root {
    --flash-bg: #0d1b2a;
    --flash-card: #1b2838;
    --flash-border: #2a3a4a;
    --flash-text: #e0e6ed;
    --flash-text-secondary: #8a9aa8;
    --flash-accent: #00bcd4;
    --flash-accent-dark: #0097a7;
    --flash-success: #4caf50;
    --flash-error: #ef5350;
    --flash-warning: #ff9800;
    --flash-font: 'Courier New', monospace;
}

.flash-btn-header {
    background: linear-gradient(135deg, #00bcd4, #0097a7) !important;
    box-shadow: 0 4px 14px rgba(0,188,212,0.30) !important;
}
.flash-btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,188,212,0.40) !important;
}

#flash-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
}

.flash-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
}

.flash-content {
    position: relative;
    background: var(--flash-card);
    border-radius: 20px;
    width: 560px;
    max-width: 92vw;
    max-height: 90vh;
    border: 1px solid var(--flash-border);
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.flash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--flash-border);
    flex-shrink: 0;
}

.flash-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--flash-text);
}

.flash-header h3 i {
    color: var(--flash-accent);
    font-size: 1.2rem;
}

.flash-close {
    background: none;
    border: none;
    color: var(--flash-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}
.flash-close:hover { color: var(--flash-text); }

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

.browser-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.25);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    color: var(--flash-warning);
}
.browser-warning i { font-size: 0.9rem; flex-shrink: 0; }

.flash-form-group {
    margin-bottom: 16px;
}
.flash-form-group:last-of-type { margin-bottom: 0; }

.flash-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--flash-text-secondary);
    margin-bottom: 6px;
}

.flash-form-group select,
.flash-form-group input {
    width: 100%;
    padding: 10px 14px;
    background: #0d1b2a;
    border: 1.5px solid var(--flash-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--flash-text);
    outline: none;
    transition: border-color 0.2s;
    appearance: auto;
}
.flash-form-group select:focus,
.flash-form-group input:focus {
    border-color: var(--flash-accent);
}

.flash-form-group select option {
    background: var(--flash-card);
    color: var(--flash-text);
}

.flash-form-row {
    display: flex;
    gap: 12px;
}
.flash-form-row .flash-form-group {
    flex: 1;
}

.flash-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.flash-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    color: white;
}
.flash-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.flash-btn-primary {
    background: linear-gradient(135deg, var(--flash-accent), var(--flash-accent-dark));
    box-shadow: 0 4px 12px rgba(0,188,212,0.25);
}
.flash-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,188,212,0.35);
}

.flash-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--flash-text);
    border: 1px solid var(--flash-border);
    flex: 0 0 auto;
}
.flash-btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.10);
}

.flash-btn-danger {
    background: rgba(239,83,80,0.15);
    color: var(--flash-error);
    border: 1px solid rgba(239,83,80,0.25);
    flex: 0 0 auto;
}
.flash-btn-danger:hover:not(:disabled) {
    background: rgba(239,83,80,0.25);
}

#flash-progress-area {
    margin-top: 16px;
    display: none;
}

.flash-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.flash-progress-header span {
    font-size: 0.8rem;
    color: var(--flash-text-secondary);
    font-weight: 500;
}

.flash-progress-bar {
    height: 6px;
    background: var(--flash-border);
    border-radius: 3px;
    overflow: hidden;
}
.flash-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--flash-accent), #4dd0e1);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.flash-log {
    margin-top: 12px;
    background: #0a1520;
    border: 1px solid var(--flash-border);
    border-radius: 8px;
    padding: 12px 14px;
    max-height: 160px;
    overflow-y: auto;
    font-family: var(--flash-font);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--flash-text-secondary);
}

.flash-log .log-info { color: #81d4fa; }
.flash-log .log-ok { color: var(--flash-success); }
.flash-log .log-err { color: var(--flash-error); }
.flash-log .log-warn { color: var(--flash-warning); }
.flash-log .log-progress { color: var(--flash-accent); }

.flash-chip-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,188,212,0.08);
    border: 1px solid rgba(0,188,212,0.15);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--flash-accent);
}
.flash-chip-info i { font-size: 0.85rem; }

@media (max-width: 600px) {
    .flash-content { width: 100%; max-width: 100vw; border-radius: 0; max-height: 100vh; }
    .flash-form-row { flex-direction: column; gap: 0; }
    .flash-actions { flex-direction: column; }
}
