/* cavm-theme.css - CSS externo separado da index.php com paleta verde/prata pastel */

:root {
    --navy: #3f5f50;
    --blue: #7faf97;
    --blue-dark: #5f8d76;
    --sky: #dceee4;
    --sky-soft: #eef4f1;
    --gold: #c8d0cc;
    --gold-soft: #f5f7f6;
    --text: #24342d;
    --muted: #60746b;
    --border: #d8e4de;
    --danger: #dc2626;
    --success: #16a34a;
    --card: #ffffff;
    --shadow: 0 18px 42px rgba(63, 95, 80, .10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(140,190,160,.25), transparent 28%),
        linear-gradient(180deg, #dceee4 0%, #eef4f1 40%, #f8faf9 100%);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 34px;
}

/* HEADER */
.header {
    text-align: center;
    padding: 12px 0 22px;
}

.logo {
    width: 150px;
    max-width: 48vw;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

.header h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: clamp(14px, 2vw, 17px);
}

.admin-link {
    margin: 16px auto 0;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--blue);
    color: #fff;
    font-weight: 800;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(127,175,151,.24);
}

/* HERO */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,.98), rgba(255,255,255,.78)),
        linear-gradient(135deg, rgba(220,238,228,.92), rgba(232,236,234,.90));
    border: 1px solid rgba(216,228,222,.95);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 42px);
    margin-bottom: 24px;
}

.hero::before {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -160px;
    top: -220px;
    background: radial-gradient(circle, rgba(127,175,151,.24), transparent 62%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    left: -180px;
    bottom: -210px;
    background: radial-gradient(circle, rgba(192,198,201,.30), transparent 64%);
    pointer-events: none;
}

.hero-intro {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 850px;
    margin: 0 auto 32px;
    animation: fadeUp .55s ease both;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(127,175,151,.14);
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 14px;
}

.hero-intro h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero-intro p {
    margin: 14px auto 0;
    color: #5f746a;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.45;
    max-width: 720px;
}

.hero-features {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.feature-card {
    position: relative;
    overflow: hidden;
    min-height: 230px;
    padding: 22px 18px;
    border-radius: 24px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(216,228,222,.95);
    box-shadow: 0 14px 32px rgba(63,95,80,.09), inset 0 1px 0 rgba(255,255,255,.95);
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    animation: fadeUp .65s ease both;
}

.feature-card:nth-child(2) { animation-delay: .06s; }
.feature-card:nth-child(3) { animation-delay: .12s; }
.feature-card:nth-child(4) { animation-delay: .18s; }

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(127,175,151,.38);
    box-shadow: 0 22px 45px rgba(63,95,80,.16), inset 0 1px 0 rgba(255,255,255,.95);
}

.feature-icon {
    width: 108px;
    height: 108px;
    margin: 0 auto 15px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #ffffff, #eef4f1);
    box-shadow: 0 12px 24px rgba(8,41,74,.10);
}

.feature-icon img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
}

.feature-card h3 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 18px;
    line-height: 1.12;
}

.feature-card p {
    margin: 0 auto;
    color: #60746b;
    font-size: 14px;
    line-height: 1.38;
    max-width: 210px;
}

/* PROGRESS */
.progress {
    background: rgba(255,255,255,.70);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
    box-shadow: 0 10px 25px rgba(63,95,80,.07);
}

.progress-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.step-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dceee4;
    color: var(--blue);
    display: grid;
    place-items: center;
    font-weight: 900;
    flex: 0 0 auto;
}

.step-dot.active {
    background: var(--blue);
    color: #fff;
}

.progress-item strong {
    display: block;
    color: var(--navy);
    font-size: 14px;
}

.progress-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

/* LAYOUT */
.app-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
    align-items: start;
}

.sidebar {
    display: grid;
    gap: 16px;
}

.card {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(63,95,80,.07);
    padding: 20px;
}

.card h2, .card h3 {
    color: var(--navy);
    margin: 0 0 9px;
}

.card p {
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.45;
}

.help-card {
    background: rgba(245,247,246,.96);
    border: 1px solid #c8d0cc;
}

.help-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    margin-top: 18px;
}

.help-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f5f7f6;
    display: grid;
    place-items: center;
    color: var(--blue);
    font-weight: 900;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.label {
    display: block;
    margin: 14px 0 8px;
    color: var(--navy);
    font-weight: 800;
}

.input,
.card input[type="text"],
.card input[type="file"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    background: #fff;
    outline: none;
    color: var(--text);
}

.input:focus,
.card input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(127,175,151,.16);
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    border: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
    font-size: 15px;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-dark);
}

.btn-secondary {
    background: #eef4f1;
    color: var(--navy);
    border: 1px solid var(--border);
}

.btn-outline {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--border);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.alert {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 14px;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.info {
    background: #eef4f1;
    color: #3f5f50;
    border: 1px solid #d8e4de;
}

/* STUDENTS */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.student {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    background: #fff;
    transition: .2s ease;
}

.student.selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(127,175,151,.16);
}

.student-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.student input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.student-name {
    color: var(--navy);
    font-weight: 900;
    margin-bottom: 5px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.existing-box {
    margin-top: 12px;
    border: 1px solid var(--border);
    background: var(--sky-soft);
    border-radius: 12px;
    padding: 11px;
}

.existing-item {
    color: var(--navy);
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(63,95,80,.09);
}

.existing-item:last-child {
    border-bottom: 0;
}

/* RESPONSÁVEIS */
.shared {
    background: var(--gold-soft);
    border: 1px solid #c8d0cc;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
}

.shared label {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--navy);
    font-weight: 900;
}

.shared input {
    width: 20px;
    height: 20px;
    accent-color: var(--blue);
}

.person-card {
    border: 1px dashed #c8d8d0;
    border-radius: 16px;
    padding: 16px;
    background: #fbfdfc;
    margin-bottom: 14px;
}

.person-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.person-title {
    color: var(--navy);
    font-weight: 900;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.preview {
    display: none;
    margin-top: 10px;
    width: 112px;
    height: 112px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

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

.footer {
    margin-top: 28px;
    padding: 22px 0 8px;
    color: var(--navy);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(63,95,80,.12);
}

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

/* RESPONSIVO */
@media (max-width: 980px) {
    .hero-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .main {
        order: 1;
    }
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 18px, 100%);
        padding-top: 8px;
    }

    .logo {
        width: 120px;
    }

    .admin-link {
        width: 100%;
    }

    .hero {
        border-radius: 22px;
        padding: 22px 16px;
    }

    .hero-intro {
        text-align: left;
        margin-bottom: 20px;
    }

    .hero-features {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .feature-card {
        min-height: auto;
        text-align: left;
        display: grid;
        grid-template-columns: 82px 1fr;
        gap: 14px;
        align-items: center;
        padding: 16px;
        border-radius: 20px;
    }

    .feature-icon {
        width: 82px;
        height: 82px;
        margin: 0;
        border-radius: 22px;
    }

    .feature-icon img {
        width: 68px;
        height: 68px;
    }

    .feature-card h3 {
        font-size: 16px;
    }

    .feature-card p {
        max-width: none;
        font-size: 13px;
    }

    .progress {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 17px;
        border-radius: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .person-header {
        align-items: stretch;
        flex-direction: column;
    }

    .footer {
        flex-direction: column;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .feature-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .feature-icon {
        margin: 0 auto;
    }
}
