/**
 * Patrimoniza - Agendamento Styles
 */

/* ============ VARIABLES ============ */
:root {
    --primary: #2d5016;
    --primary-light: #4a7c23;
    --primary-dark: #1e3a0f;
    --accent: #c9a227;
    --success: #28a745;
    --error: #dc3545;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg: #f4f6f8;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ HEADER ============ */
.header {
    background: var(--bg-white);
    padding: 16px 0;
    box-shadow: var(--shadow);
}

.logo-img {
    height: 36px;
}

/* ============ MAIN ============ */
.main {
    flex: 1;
    padding: 40px 0;
}

/* ============ HERO SECTION ============ */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* ============ SCHEDULING SECTION ============ */
.scheduling-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.scheduling-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 450px;
}

@media (max-width: 768px) {
    .scheduling-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ CALENDAR SIDE ============ */
.calendar-side {
    padding: 24px;
    border-right: 1px solid var(--border);
}

@media (max-width: 768px) {
    .calendar-side {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

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

.calendar-month {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.calendar-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.calendar-nav:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.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(--text-muted);
    text-transform: uppercase;
    padding: 8px 0;
}

.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;
    font-size: 0.9rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

.calendar-day.past,
.calendar-day.unavailable {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.available {
    color: var(--text);
    background: var(--bg);
}

.calendar-day.available:hover {
    background: #e8f4e8;
    border-color: var(--primary-light);
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    border-color: var(--accent);
}

.calendar-legend {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.available {
    background: var(--bg);
    border: 1px solid var(--border);
}

.legend-dot.selected {
    background: var(--primary);
}

.legend-dot.unavailable {
    background: var(--text-muted);
    opacity: 0.5;
}

/* ============ TIMESLOTS SIDE ============ */
.timeslots-side {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.timeslots-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.timeslots-placeholder p {
    max-width: 200px;
}

.timeslots-content {
    flex: 1;
}

.timeslots-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.timeslots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .timeslots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.timeslot {
    padding: 12px;
    text-align: center;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.timeslot:hover {
    background: #e8f4e8;
    border-color: var(--primary-light);
}

.timeslot.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.timeslot.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.timeslots-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============ CONFIRMATION SECTION ============ */
.confirmation-section {
    margin-top: 40px;
}

.confirmation-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.confirmation-header {
    text-align: center;
    margin-bottom: 32px;
}

.confirmation-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.selected-datetime {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.datetime-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: var(--text);
}

.datetime-icon {
    font-size: 1.3rem;
}

.datetime-value {
    font-weight: 600;
}

/* ============ FORM ============ */
.confirmation-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 20px;
}

.form-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row--half {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column-reverse;
    }
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-light);
}

.loading-spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============ SUCCESS SECTION ============ */
.success-section {
    margin-top: 40px;
}

.success-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 32px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 24px;
}

.success-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 16px;
}

.success-message {
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.6;
}

.success-details {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-light);
}

.detail-value {
    font-weight: 600;
    color: var(--text);
}

.success-reminder {
    background: #fff9e6;
    border: 1px solid #f0e68c;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.success-reminder p {
    font-size: 0.9rem;
    color: #856404;
    margin: 0;
}

.success-actions {
    margin-top: 24px;
}

/* ============ FOOTER ============ */
.footer {
    background: var(--bg-white);
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

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

/* ============ NO SLOTS MESSAGE ============ */
.no-slots-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.no-slots-message .no-slots-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-slots-message p {
    margin-bottom: 8px;
}

.no-slots-message .suggestion {
    font-size: 0.9rem;
    color: var(--text-muted);
}
