/* ==========================================================================
   PATIENTSNAP - PREMIUM GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #070a13;
    --card-bg: rgba(13, 20, 38, 0.55);
    --card-border: rgba(255, 255, 255, 0.07);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    
    --primary: #06b6d4;          /* Electric Cyan */
    --primary-glow: rgba(6, 182, 212, 0.35);
    --primary-hover: #22d3ee;
    
    --secondary: #6366f1;        /* Indigo */
    --secondary-glow: rgba(99, 102, 241, 0.25);
    
    --accent: #10b981;           /* Emerald Green */
    --accent-glow: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b;          /* Amber */
    --danger: #ef4444;           /* Red */
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* UI Sizing */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ==========================================================================
   DYNAMIC AMBIENT BACKGROUNDS
   ========================================================================== */

.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0c1224 0%, #05070f 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    mix-blend-mode: screen;
    animation: pulse 12s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 55vw;
    height: 55vw;
    background: var(--secondary);
    animation-delay: -4s;
}

.blob-3 {
    top: 40%;
    left: 45%;
    width: 35vw;
    height: 35vw;
    background: var(--accent);
    animation-delay: -8s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(8%, 5%); }
}

/* ==========================================================================
   APPLICATION WRAPPER
   ========================================================================== */

.app-container {
    width: 100%;
    max-width: 540px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .app-container {
        padding: 2.5rem 1.5rem;
    }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--primary-glow);
}

.logo-icon i {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   SPA SCREEN CONTROLS & ANIMATIONS
   ========================================================================== */

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.spa-screen {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.spa-screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   GLASS CARDS & CONTAINERS
   ========================================================================== */

.screen-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 var(--glass-highlight);
    position: relative;
    overflow: hidden;
}

.screen-card.wide-card {
    max-width: 100%;
}

@media (min-width: 1024px) {
    .app-container:has(.wide-card) {
        max-width: 800px;
    }
}

.card-header {
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.card-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Back button */
.btn-back {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 1.25rem;
    padding: 0;
    gap: 0.25rem;
    transition: var(--transition-fast);
}

.btn-back:hover {
    color: var(--primary);
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group label i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.input-group input[type="text"],
.input-group input[type="url"],
.input-group input[type="password"],
.input-group select {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group select option {
    background: #0f172a;
    color: var(--text-primary);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(6, 182, 212, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-secondary-light {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.btn-secondary-light:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: var(--primary);
}

.btn-danger-light {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-danger-light:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-icon-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.btn-icon-text:hover {
    color: var(--primary);
}

.w-100 { width: 100%; }
.d-none { display: none !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-2 { margin-bottom: 0.75rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.text-center { text-align: center; }

/* ==========================================================================
   SCREEN 2 - STATUS DE ATENDIMENTO
   ========================================================================== */

.city-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(6, 182, 212, 0.12);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.status-indicator {
    padding: 1.5rem 0;
    animation: fadeIn var(--transition-fast);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px stroke rgba(255,255,255,0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s infinite linear;
}

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

.status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.status-icon i {
    width: 36px;
    height: 36px;
}

.icon-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.icon-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.path-preview {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--card-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.patient-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.patient-stats i {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   SCREEN 3 - AUTO-COMPLETE & SESSION TYPE CARD
   ========================================================================== */

.search-group {
    position: relative;
}

.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0f1526;
    border: 1px solid #1e293b;
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    animation: fadeIn var(--transition-fast);
}

.suggestions-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.5rem 0.875rem 0.25rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#suggestions-list {
    list-style: none;
}

#suggestions-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
}

#suggestions-list li:hover {
    background: rgba(6, 182, 212, 0.1);
}

#suggestions-list li .badge {
    background: var(--secondary-glow);
    color: #a5b4fc;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.session-type-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideIn var(--transition-fast);
}

.session-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.badge-after {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-before {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.session-type-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.session-type-card strong {
    color: var(--text-primary);
}

/* ==========================================================================
   SCREEN 4 - CAMERA & FILE SOURCE
   ========================================================================== */

.session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.meta-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-item i {
    width: 15px;
    height: 15px;
    color: var(--primary);
}

.meta-item strong {
    color: var(--text-primary);
}

/* Source Selection Cards */
.media-source-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .media-source-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.source-card {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-fast);
}

.source-card:hover {
    background: rgba(6, 182, 212, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.source-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--primary);
    transition: var(--transition-fast);
    border: 1px solid var(--card-border);
}

.source-icon i {
    width: 24px;
    height: 24px;
}

.source-card:hover .source-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
    border-color: transparent;
}

.source-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.source-card p {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

/* Live Camera Stream Interface */
.camera-container {
    background: black;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    animation: fadeIn var(--transition-fast);
}

.camera-view-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 133.33%; /* 4:3 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

#camera-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.guide-grid {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
}

.guide-grid::before,
.guide-grid::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
}

/* Rule of Thirds Guide Lines */
.guide-grid::before {
    left: 33.33%;
    right: 33.33%;
    top: 0;
    bottom: 0;
    border-left: 1px dashed rgba(255, 255, 255, 0.15);
    border-right: 1px dashed rgba(255, 255, 255, 0.15);
}

.guide-grid::after {
    top: 33.33%;
    bottom: 33.33%;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.camera-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
}

.camera-flash.flash-active {
    animation: flashEffect 0.3s ease-out;
}

@keyframes flashEffect {
    0% { opacity: 0.9; }
    100% { opacity: 0; }
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 1.25rem 1rem;
    background: rgba(7, 10, 19, 0.95);
    backdrop-filter: blur(10px);
}

.btn-capture {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-capture:hover {
    transform: scale(1.05);
}

.btn-capture:active {
    transform: scale(0.95);
}

.capture-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid black;
    background: white;
}

.camera-controls .btn-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
}

/* Photos Grid Section */
.photos-section {
    animation: slideIn var(--transition-fast);
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title-bar h3 {
    font-size: 1.125rem;
    font-weight: 700;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.photo-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    animation: zoomIn var(--transition-fast);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex: 1;
}

.photo-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: var(--transition-fast);
}

.photo-delete-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.photo-delete-btn i {
    width: 14px;
    height: 14px;
}

.photo-meta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    padding: 0.75rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Custom Before / After Selector Select */
.tag-selector-wrapper {
    width: 100%;
}

.tag-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-select:focus {
    border-color: var(--primary);
}

.tag-select option {
    background: #0f1526;
    color: white;
}

.tag-select.select-antes {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: #22d3ee;
}

.tag-select.select-depois {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

/* ==========================================================================
   SCREEN 5 - SYNCHRONIZATION AND UPLOADS
   ========================================================================== */

.progress-ring-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bar {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.progress-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2rem;
}

.upload-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    animation: slideIn var(--transition-fast);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.file-tag.tag-antes { color: var(--primary); }
.file-tag.tag-depois { color: var(--secondary); }

.file-status {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-pending { color: var(--text-muted); }
.status-uploading { color: var(--primary); }
.status-completed { color: var(--accent); }
.status-failed { color: var(--danger); }

/* ==========================================================================
   SCREEN 6 - SUCCESS
   ========================================================================== */

.success-checkmark-wrapper {
    width: 80px;
    height: 80px;
    margin: 1rem auto 1.75rem;
    position: relative;
}

.success-checkmark-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 2px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scalePulse 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
}

.success-checkmark-circle i {
    width: 40px;
    height: 40px;
}

@keyframes scalePulse {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-details-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0.5rem;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row span {
    color: var(--text-secondary);
}

.destination-path {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(6, 182, 212, 0.05);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(6, 182, 212, 0.1);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   SETTINGS MODAL
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn var(--transition-fast);
}

.modal-card {
    width: 100%;
    max-width: 460px;
    background: #0f1526;
    border: 1px solid #1e293b;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: scalePulse 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2 i {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Toggle Switch Control */
.toggle-group {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 75%;
}

.toggle-text label {
    margin-bottom: 0 !important;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================================================
   GLOBAL FOOTER
   ========================================================================== */

.app-footer {
    text-align: center;
    margin-top: 2rem;
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

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

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Botão Verde de Sucesso/Conclusão */
.btn-accent-light {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-accent-light:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent);
    color: white;
}

/* Contador de Fotos Flutuante sobre a Câmera */
.camera-photo-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 0.85rem;
    border-radius: 50px;
    color: white;
    font-size: 0.825rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10;
    animation: slideIn var(--transition-fast);
}

.camera-photo-counter i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

/* Miniatura Flutuante de Feedback */
.camera-mini-preview {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 60px;
    height: 75px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    background: #000;
    z-index: 10;
    animation: scalePulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom left;
}

.camera-mini-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
