@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@500;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --color-bg: #faf7f2;
    --color-surface: #ffffff;
    --color-mint: #aee9c8;
    --color-mint-dark: #7ccca0;
    --color-lilac: #d6cbe8;
    --color-mauve: #9b6bb3;
    --color-mauve-dark: #7a4f8f;
    --color-dark: #1c1c1e;
    --color-primary: #7ccca0;
    --color-primary-dark: #4f9c74;
    --color-text: #2b2b2b;
    --color-text-muted: #6b6b6b;
    --color-text-on-dark: #f2f0eb;
    --color-border: #e5ddd0;
    --color-error-bg: #fbe4e1;
    --color-error-text: #a33a2f;
    --color-success-bg: #e3f0e6;
    --color-success-text: #2f6b3e;
    --radius: 14px;
    --radius-pill: 999px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.1);
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Roboto Slab', Georgia, serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
}

a {
    color: var(--color-mauve-dark);
}

/* --- Buttons shared --- */

.btn-primary,
.btn-primary-link {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-mauve);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover,
.btn-primary-link:hover {
    background: var(--color-mauve-dark);
    transform: translateY(-1px);
}

.btn-on-dark {
    background: var(--color-mint);
    color: var(--color-dark);
}

.btn-on-dark:hover {
    background: var(--color-mint-dark);
}

/* --- Auth (login) --- */

.auth-page {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, var(--color-lilac) 0%, var(--color-bg) 45%);
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lift);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--color-mauve-dark);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-mint) 0%, var(--color-lilac) 100%);
    box-shadow: var(--shadow);
}

.tagline {
    margin: 0 0 28px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.auth-form label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    margin-top: 16px;
    color: var(--color-text-muted);
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-mauve);
}

.auth-form .btn-primary {
    margin-top: 24px;
    width: 100%;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

/* --- Topbar (app pages) --- */

.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar .brand {
    margin: 0;
    font-size: 1.2rem;
}

.topbar nav a {
    color: var(--color-mauve-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.topbar nav a:hover {
    text-decoration: underline;
}

.logout-form {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.role-badge {
    display: inline-block;
    background: var(--color-lilac);
    color: var(--color-mauve-dark);
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    margin-right: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-mauve-dark);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}

/* --- Dashboard --- */

.dashboard-grid {
    max-width: 900px;
    margin: 48px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    border-top: 4px solid var(--color-mint);
    box-shadow: var(--shadow);
    padding: 28px;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
}

.dashboard-card:nth-child(even) {
    border-top-color: var(--color-lilac);
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}

.dashboard-card h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    color: var(--color-mauve-dark);
    font-size: 1.15rem;
}

.dashboard-card p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.dashboard-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Landing --- */

.landing-header {
    background: var(--color-surface);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-header .brand {
    margin: 0;
    font-size: 1.3rem;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 96px 24px 88px;
    text-align: center;
}

.hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(250, 247, 242, 0.5) 0%, rgba(250, 247, 242, 0.87) 60%, rgba(250, 247, 242, 0.97) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-mauve-dark);
    box-shadow: var(--shadow);
}

.landing-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-mauve);
    font-size: 2.75rem;
    line-height: 1.22;
}

.landing-hero p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    font-size: 1.02rem;
    box-shadow: var(--shadow-lift);
}

.landing-band {
    background: var(--color-mint);
    padding: 40px 24px;
    text-align: center;
}

.landing-band p {
    margin: 0 0 20px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--color-dark);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.landing-band .btn-primary-link {
    background: var(--color-dark);
}

.landing-band .btn-primary-link:hover {
    background: #000;
}

.services-section {
    background: var(--color-lilac);
    padding: 64px 24px;
}

.services-section h2 {
    text-align: center;
    font-family: var(--font-display);
    color: var(--color-dark);
    font-size: 1.6rem;
    margin: 0 0 32px;
}

.services-grid {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

.service-card {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 14px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.service-card:hover {
    transform: translateY(-3px);
}

.service-card h3 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--color-mauve-dark);
    font-size: 1rem;
    font-weight: 500;
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(155, 107, 179, 0.1);
}

.office-photo-section {
    padding: 64px 24px;
    background: var(--color-bg);
}

.office-photo-frame {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lift);
}

.office-photo {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

.landing-footer {
    background: var(--color-dark);
    color: var(--color-text-on-dark);
    padding: 32px;
    text-align: center;
}

.landing-footer p {
    margin: 0;
    color: #b8b5ad;
    font-size: 0.85rem;
}

.landing-footer a {
    color: var(--color-mint);
}

@media (max-width: 480px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .landing-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .landing-hero {
        padding: 56px 22px 52px;
    }

    .landing-hero h1 {
        font-size: 1.8rem;
    }

    .services-grid {
        gap: 6px;
    }

    .service-card {
        padding: 14px 4px;
    }

    .service-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
    }

    .service-icon svg {
        width: 18px;
        height: 18px;
    }

    .service-card h3 {
        font-size: 0.8rem;
    }

    .office-photo {
        height: 220px;
    }
}

/* --- App content pages (tasks, appointments) --- */

.page-content {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 24px 48px;
}

.page-content h1 {
    font-family: var(--font-display);
    color: var(--color-mauve-dark);
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.card-panel {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-top: 20px;
}

.card-panel h3 {
    margin-top: 0;
    font-family: var(--font-display);
    color: var(--color-mauve-dark);
    font-size: 1.1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-lilac);
    color: var(--color-dark);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .completada {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.form-row {
    margin: 14px 0;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface);
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--color-mauve);
}

.btn-action {
    cursor: pointer;
    padding: 8px 16px;
    margin-right: 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}

.btn-action:hover {
    background: var(--color-lilac);
}

.btn-action.danger:hover {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.btn-submit {
    cursor: pointer;
    padding: 10px 24px;
    margin-top: 12px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-mauve);
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s ease;
}

.btn-submit:hover {
    background: var(--color-mauve-dark);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.slot-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 0.9rem;
}

.form-error {
    color: var(--color-error-text);
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
}

.success-banner {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.conflict-banner {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* --- Floating WhatsApp button (every page) --- */

.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25d366;
    color: white;
    border-radius: 50%;
    box-shadow: var(--shadow-lift);
    z-index: 1000;
    transition: transform 0.15s ease;
}

.whatsapp-float:hover {
    transform: scale(1.08);
}

@media (max-width: 480px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 48px;
        height: 48px;
    }
}
