/* ============================================
   ERP Erika Monteiro — Portal Público
   Design System: Rose Gold Premium, Mobile-First
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --rose-50: #FFF5F5;
    --rose-100: #FDE8E8;
    --rose-200: #F5C6C6;
    --rose-300: #E8A0A0;
    --rose-400: #D4A0A0;
    --rose-500: #C27878;
    --rose-600: #A85555;
    --gold: #C9A96E;
    --gold-light: #E2D1A8;
    --gold-dark: #A88A4E;
    --snow: #FAFAFA;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --green-500: #10B981;
    --green-100: #D1FAE5;
    --red-500: #EF4444;
    --red-100: #FEE2E2;
    --blue-500: #3B82F6;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(201,169,110,0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--rose-50) 0%, var(--snow) 50%, var(--rose-100) 100%);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background Decoration ---------- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(212,160,160,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ---------- Main Container ---------- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
    text-align: center;
    padding: 24px 0 16px;
}

.app-header .logo-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gold-light);
    box-shadow: var(--shadow-glow);
    animation: fadeInDown 0.6s ease-out;
}

.app-header .logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    animation: fadeInDown 0.6s ease-out 0.1s both;
}

.app-header .subtitle {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 2px;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

/* ---------- Progress Steps ---------- */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 0;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-400);
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.step-circle.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold);
    color: var(--white);
    box-shadow: 0 0 12px rgba(201,169,110,0.4);
    transform: scale(1.1);
}

.step-circle.completed {
    background: var(--green-500);
    border-color: var(--green-500);
    color: var(--white);
}

.step-line {
    width: 30px;
    height: 2px;
    background: var(--gray-200);
    transition: var(--transition);
    flex-shrink: 0;
}

.step-line.completed {
    background: var(--green-500);
}

/* ---------- Card / Step Container ---------- */
.step-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    flex: 1;
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.step-card.active {
    display: block;
}

.step-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.step-card .step-description {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ---------- Form Elements ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

/* ---------- Category Filters ---------- */
.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.category-filters::-webkit-scrollbar { display: none; }

.category-chip {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.category-chip:hover {
    border-color: var(--gold-light);
    color: var(--gold-dark);
}

.category-chip.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold);
    color: var(--white);
}

/* ---------- Service Cards ---------- */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.service-card.selected {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201,169,110,0.05), rgba(201,169,110,0.1));
    box-shadow: var(--shadow-glow);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--rose-100), var(--rose-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.service-meta .dot {
    width: 3px;
    height: 3px;
    background: var(--gray-400);
    border-radius: 50%;
}

.service-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-dark);
    white-space: nowrap;
}

/* ---------- Professional Cards ---------- */
.professionals-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.professional-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--white);
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.professional-card:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.professional-card.selected {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(201,169,110,0.05), rgba(201,169,110,0.1));
}

.prof-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-200), var(--rose-400));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    overflow: hidden;
}

.prof-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prof-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.prof-info .prof-specialty {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ---------- Calendar ---------- */
.calendar-container {
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    text-transform: capitalize;
}

.calendar-nav button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.calendar-nav button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.calendar-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    padding: 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    color: var(--gray-700);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.disabled {
    color: var(--gray-300);
    cursor: not-allowed;
}

.calendar-day.available {
    background: var(--green-100);
    color: var(--green-500);
    font-weight: 600;
}

.calendar-day.available:hover {
    background: var(--green-500);
    color: var(--white);
    transform: scale(1.1);
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(201,169,110,0.4);
}

.calendar-day.today {
    border: 2px solid var(--gold);
}

/* ---------- Time Slots ---------- */
.slots-container {
    margin-top: 16px;
}

.slots-container h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.slot-btn {
    padding: 10px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.slot-btn:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(201,169,110,0.05);
}

.slot-btn.selected {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-color: var(--gold);
    color: var(--white);
    box-shadow: 0 0 10px rgba(201,169,110,0.3);
}

/* ---------- Summary Card ---------- */
.summary-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1.5px solid var(--gray-100);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.summary-row:last-child {
    border-bottom: none;
    padding-top: 16px;
}

.summary-row .label {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-row .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
}

.summary-row.total .label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.summary-row.total .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-dark);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(201,169,110,0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,169,110,0.5);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
    border-color: var(--gold-light);
    color: var(--gold-dark);
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
    box-shadow: 0 4px 14px rgba(37,211,102,0.4);
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.btn-payment {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.btn-payment:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    flex: 1;
}

/* ---------- Success Screen ---------- */
.success-screen {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-100), #A7F3D0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-screen h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.success-screen p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ---------- Loading / Spinner ---------- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 12px;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-400);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ---------- Error Toast ---------- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: var(--red-500);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--green-500);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .app-container { padding: 24px; }
    .step-card { padding: 36px 32px; }
    .app-header h1 { font-size: 2rem; }
    .slots-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1024px) {
    .app-container { max-width: 640px; }
}
