/* === Upload Zone === */
.reg-receipt-upload-zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reg-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.reg-upload-area:hover,
.reg-upload-area--dragover {
    border-color: #033878;
    background: #eff6ff;
}

.reg-upload-area__icon {
    color: #94a3b8;
    margin-bottom: 12px;
}

.reg-upload-area__text {
    color: #475569;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.reg-upload-area__text small {
    color: #94a3b8;
}

.reg-upload-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.reg-upload-actions .reg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    padding: 10px 12px;
}

/* === Camera === */
.reg-camera-wrap {
    position: relative;
    display: none;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.reg-camera-wrap.active {
    display: block;
}

.reg-camera-wrap video {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

@media (min-width: 768px) {
    .reg-camera-wrap video {
        aspect-ratio: 16 / 10;
    }
}

.reg-scan-box {
    position: absolute;
    top: 50%; left: 50%;
    width: min(70%, 280px);
    height: min(70%, 280px);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
    pointer-events: none;
}

.reg-scan-line {
    position: absolute;
    left: 50%; top: 50%;
    width: min(70%, 280px);
    height: 2px;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, #22c55e 20%, #22c55e 80%, transparent);
    animation: reg-sweep 2.2s linear infinite;
    pointer-events: none;
}

@keyframes reg-sweep {
    0%   { transform: translate(-50%, calc(-50% - 130px)); }
    50%  { transform: translate(-50%, calc(-50% + 130px)); }
    100% { transform: translate(-50%, calc(-50% - 130px)); }
}

.reg-stop-camera-btn {
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

/* === Status === */
.reg-upload-status {
    font-size: 14px;
    min-height: 20px;
    padding: 4px 0;
}
.reg-upload-status.ok   { color: #16a34a; }
.reg-upload-status.warn { color: #d97706; }
.reg-upload-status.err  { color: #dc2626; }

/* === QR validation indicator === */
.reg-qr-validation-status {
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}
.reg-qr-validation-status.valid   { color: #16a34a; }
.reg-qr-validation-status.invalid { color: #dc2626; }

.reg-receipt-qr-input.is-valid   { border-color: #16a34a !important; }
.reg-receipt-qr-input.is-invalid { border-color: #dc2626 !important; }

/* === Result screen === */
.reg-result {
    text-align: center;
    padding: 16px 0;
}

.reg-result__icon {
    margin: 0 auto 16px;
    display: block;
}

.reg-result__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1e293b;
}

.reg-result__message,
.reg-result__cashback {
    color: #475569;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 16px;
}

.reg-result__cashback strong {
    color: #16a34a;
    font-size: 22px;
}

.reg-result__details {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    margin-top: 12px;
}

.reg-result__details p {
    margin: 4px 0;
    color: #475569;
}

.reg-result__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

@media (max-width: 480px) {
    .reg-result__actions {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ПОЛНОЭКРАННЫЙ РЕЖИМ КАМЕРЫ
   Управление через класс .reg-camera-active на .modal-body
   ============================================ */

/* По умолчанию камера скрыта */
.reg-camera-wrap {
    display: none;
}

.reg-camera-wrap.active {
    display: block;
}

/* Когда камера активна — скрываем основной контент */
.modal-body.reg-camera-active .reg-upload-content {
    display: none !important;
}

/* Камера на всю ширину и высоту modal-body */
.modal-body.reg-camera-active .reg-camera-wrap {
    position: relative;
    width: 100%;
    min-height: 300px;
    max-height: 65vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.modal-body.reg-camera-active .reg-camera-wrap video {
    width: 100%;
    height: 100%;
    min-height: 300px;
    max-height: 65vh;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .modal-body.reg-camera-active .reg-camera-wrap,
    .modal-body.reg-camera-active .reg-camera-wrap video {
        max-height: 70vh;
    }
}

/* Scan overlay elements */
.reg-scan-box {
    position: absolute;
    top: 50%; left: 50%;
    width: min(70%, 280px);
    height: min(70%, 280px);
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
    pointer-events: none;
}

.reg-scan-line {
    position: absolute;
    left: 50%; top: 50%;
    width: min(70%, 280px);
    height: 2px;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, #22c55e 20%, #22c55e 80%, transparent);
    animation: reg-sweep 2.2s linear infinite;
    pointer-events: none;
}

@keyframes reg-sweep {
    0%   { transform: translate(-50%, calc(-50% - 130px)); }
    50%  { transform: translate(-50%, calc(-50% + 130px)); }
    100% { transform: translate(-50%, calc(-50% - 130px)); }
}

.reg-stop-camera-btn {
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    z-index: 10;
}

/* === Spinner for receipt processing === */
.reg-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--dark-blue, #033878);
    border-radius: 50%;
    animation: reg-spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.reg-result--processing {
    text-align: center;
    padding: 32px 0;
}
