/* css/downloadModal.css */
/**
 * Styling modal pengiriman desain pelanggan Dream Studio.
 * Dua tab: Kirim Email dan Scan QR Code.
 */

/* === Overlay & Container === */
#download-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

#download-modal.active {
    display: flex;
}

.dm-container {
    background: #ffffff;
    border-radius: 10px;
    width: 720px;
    max-width: 90vw;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: dm-slide-in 0.25s ease;
}

@keyframes dm-slide-in {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Header === */
.dm-header {
    background: #C8102E;
    padding: 22px 28px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dm-header-text h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: 0.3px;
}

.dm-header-text p {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    margin: 0;
}

.dm-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.dm-close-btn:hover,
.dm-close-btn.focused {
    background: rgba(255,255,255,0.3);
}

/* === Tab Switcher === */
.dm-tabs {
    display: flex;
    border-bottom: 2px solid #f1f1f1;
    padding: 0 28px;
    gap: 0;
    background: #fafafa;
}

.dm-tab-btn {
    flex: 1;
    padding: 14px 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dm-tab-btn img {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.dm-tab-btn.active,
.dm-tab-btn.focused {
    color: #C8102E;
    border-bottom-color: #C8102E;
}

.dm-tab-btn.active img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(14%) sepia(94%) saturate(4500%) hue-rotate(349deg) brightness(90%);
}

/* === Body Panels === */
.dm-body {
    padding: 26px 28px 28px;
}

/* --- Panel Email --- */
#dm-panel-email {
    display: block;
}

.dm-form-group {
    margin-bottom: 16px;
}

.dm-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.dm-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.dm-form-group input:focus {
    border-color: #C8102E;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* Tombol submit email */
#dm-submit-btn {
    width: 100%;
    padding: 14px;
    background: #C8102E;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    transition: background 0.15s, transform 0.1s;
}

#dm-submit-btn:hover,
#dm-submit-btn.focused {
    background: #a00d24;
}

#dm-submit-btn:active {
    transform: scale(0.98);
}

#dm-submit-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

#dm-submit-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Spinner loading */
.dm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: dm-spin 0.7s linear infinite;
}

@keyframes dm-spin {
    to { transform: rotate(360deg); }
}

/* Pesan status */
.dm-status-msg {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: none;
}

.dm-status-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.dm-status-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* --- Panel QR --- */
#dm-panel-qr {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    text-align: center;
}

.dm-qr-label {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.dm-qr-wrapper {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#dm-qr-img {
    width: 220px;
    height: 220px;
    display: block;
}

.dm-qr-hint {
    font-size: 12px;
    color: #94a3b8;
}
