:root {
    /* Premium Aesthetic Color Palette */
    --primary: rgb(184, 194, 175);       /* Soft sage green */
    --primary-dark: rgb(164, 174, 155);
    --secondary: #E8DDD7;     /* Soft dusty pink/beige */
    --accent: #8C6A52;        /* Darker contrast brown */
    --bg-main: #F8F6F4;       /* Very light warm background */
    --glass-bg: rgba(255, 255, 255, 0.85); /* Frosty glass */
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #423E3A;
    --text-light: #837B75;
    --success: #679269;
    --success-light: #ECF4ED;
    --error: #D66D6D;
    --error-light: #FDF1F1;
    
    --shadow-soft: 0 10px 40px rgba(140, 106, 82, 0.08);
    --shadow-sm: 0 4px 12px rgba(140, 106, 82, 0.05);
    
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* App-like feel, scroll inside containers */
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-main); font-weight: 500; }
p, span, label { color: var(--text-main); font-weight: 300; }
.hidden { display: none !important; }

/* Layout Architecture for iPad */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}
.logo-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand h2 {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 600;
}
.brand span {
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 400;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-light);
    font-weight: 400;
    font-size: 16px;
    transition: all 0.3s ease;
}
.nav-item svg {
    color: inherit;
}
.nav-item:hover {
    background: rgba(255,255,255,0.5);
    color: var(--text-main);
}
.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(207, 175, 152, 0.4);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.user-profile img {
    border-radius: 50%;
    border: 2px solid white;
}
.user-info strong { font-weight: 500; font-size: 15px; display: block; }
.user-info span { font-size: 13px; color: var(--text-light); }

/* Main Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(207,175,152,0.1), transparent 50%);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 32px 48px;
}
.top-header h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-top: 4px;
}
.date-display {
    padding: 8px 16px;
    background: white;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.content-area {
    padding: 0 48px 48px 48px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Glass Panel Elements */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.form-container {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Steps Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}
.step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: all 0.3s ease;
}
.step.active {
    opacity: 1;
}
.step.active .step-num {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.step.completed .step-num {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
}
.step.active .step-label {
    font-weight: 500;
    color: var(--text-main);
}
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.3s;
}
.step-label {
    font-size: 14px;
    white-space: nowrap;
}
.step-line {
    height: 2px;
    background: var(--secondary);
    flex: 1;
    max-width: 60px;
    margin: 0 16px;
}

/* Form Styling */
.step-header {
    margin-bottom: 32px;
}
.step-header h3 {
    font-size: 24px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.step-header p {
    color: var(--text-light);
    font-size: 16px;
}
.alert-icon {
    font-size: 20px;
}
.section-title {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--secondary);
}
.mt-4 { margin-top: 32px; }
.mt-2 { margin-top: 16px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.full-width {
    grid-column: span 2;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Important para impedir que inputs vazem no grid do iPad */
}
.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}
.form-group label small {
    font-weight: 300;
    color: var(--text-light);
}
.req { color: var(--error); }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    padding: 14px 16px;
    border: 1.5px solid var(--secondary);
    border-radius: var(--radius-md);
    background: white;
    font-size: 16px;
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: var(--font-family);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block; /* Garante que respeite o width no Safari/iPad */
    outline: none;
}
input::placeholder { color: #AFA8A3; }
input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(207, 175, 152, 0.2);
}

.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    color: var(--text-light);
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
select { -webkit-appearance: none; appearance: none; padding-right: 36px; }

/* Radio Pills (Premium aesthetic for choices) */
.radio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.radio-pill {
    position: relative;
    cursor: pointer;
}
.radio-pill input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}
.radio-pill {
    padding: 12px 24px;
    background: white;
    border: 1.5px solid var(--secondary);
    border-radius: 30px;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.radio-pill:hover {
    border-color: var(--primary);
}
.radio-pill:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(207, 175, 152, 0.3);
}

.styles-options .radio-pill {
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    flex: 1;
}
.pill-title { font-weight: 500; font-size: 16px; margin-bottom: 4px; display: block;}
.pill-desc { font-size: 13px; opacity: 0.8; font-weight: 300;}

/* File Upload */
.file-upload-box {
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.file-upload-box:hover {
    background: white;
    border-color: var(--primary-dark);
}
.file-upload-box svg { color: var(--primary); margin-bottom: 12px; }
.file-upload-box p { font-weight: 500; font-size: 16px; }
.file-limits { font-size: 13px; color: var(--text-light); display: inline-block; margin-top: 8px;}
.file-preview-container {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.file-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--secondary);
}

/* Atendimentos - Search & Selected Client Badge */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
}
.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: var(--bg-main);
}
.search-result-item h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-dark);
}
.search-result-item p {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}

.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.client-badge-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.client-badge-info h4 { margin: 0 0 2px 0; font-size: 15px; }
.client-badge-info p { margin: 0; font-size: 13px; color: var(--text-light); }

/* Termo de consentimento */
.termo-box {
    padding: 24px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--secondary);
}
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}
.checkbox-label input {
    position: absolute;
    opacity: 0;
}
.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: white;
}
.checkbox-label input:checked ~ .checkbox-custom {
    background: var(--primary);
}
.checkbox-label input:checked ~ .checkbox-custom::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}
.termo-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--secondary);
}

.indicator-dots {
    display: flex;
    gap: 8px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    transition: all 0.3s;
}
.dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: none;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(207, 175, 152, 0.4);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(207, 175, 152, 0.5);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary-dark);
}
.btn-outline:hover {
    background: rgba(207, 175, 152, 0.1);
}
.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(103, 146, 105, 0.4);
}
.btn-success:hover {
    background: #557E57;
    transform: translateY(-2px);
}

/* Animations */
.form-step {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}
.modal-content {
    position: relative;
    padding: 48px;
    max-width: 400px;
    width: 90%;
    z-index: 101;
}
.success-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: var(--success);
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}
@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

/* Clients View Data */
.client-card {
    background: white;
    border: 1px solid var(--secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}
.client-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.client-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary-dark);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 500;
}
.client-info { flex: 1; margin-left: 16px; }
.client-info h4 { font-size: 16px; font-weight: 500; }
.client-info p { font-size: 14px; color: var(--text-light); }
.client-tag {
    font-size: 12px;
    background: rgba(207, 175, 152, 0.2);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* Utilities */
.text-center { text-align: center; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 16px; flex-direction: row; align-items: center; justify-content: space-between; border-right: none; border-bottom: 1px solid var(--secondary);}
    .brand { margin-bottom: 0; }
    .nav-menu { flex: initial; flex-direction: row; gap: 4px; }
    .nav-item span { display: none; }
    .nav-item { padding: 10px; }
    .user-profile { display: none; }
    .top-header { padding: 24px; flex-direction: column; align-items: flex-start; gap: 12px; }
    .content-area { padding: 0 16px 24px 16px; }
    .form-container { padding: 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .step-label { display: none; }
    .step-line { margin: 0 8px; }
}
