:root {
    --page-bg: #f0fdf4;
    --line-color: #4ade80;
    --line-dark: #15803d;
    --box-bg: #ffffff;
    --box-border: 2px solid #86efac;
    --decision-bg: #dcfce7;
    --start-bg: #16a34a;
    --start-text: #ffffff;
    --text-color: #374151;
    --shadow-soft: 0 4px 20px rgba(22, 163, 74, 0.15);
    --font-family: 'Segoe UI', 'Roboto', sans-serif;
}

body {
    background-color: var(--page-bg);
    font-family: var(--font-family);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 50px;
    color: var(--text-color);
}

.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    color: var(--line-dark);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    border-bottom: 3px solid var(--line-color);
}

.title-nav {
    font-weight: 700;
    font-size: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.title-nav i {
    color: var(--start-bg);
}

.btn-nav {
    background: var(--decision-bg);
    border: 1px solid var(--line-color);
    color: var(--line-dark);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-weight: 600;
}

.btn-nav:hover {
    background: var(--line-color);
    color: white;
}

.diagram-area {
    margin-top: 100px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    max-width: 1000px;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e0f2f1;
}
.start-oval {
    background: var(--start-bg);
    color: var(--start-text);
    border: none;
    border-radius: 50px;
    padding: 20px 50px;
    text-align: center;
    font-weight: 700;
    margin-bottom: 50px;
    max-width: 600px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 15px rgba(22, 163, 74, 0.2);
    letter-spacing: 0.5px;
}

.flow-grid {
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    width: 100%;
    gap: 10px;
    position: relative;
}

.flow-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.decision-box {
    background: var(--decision-bg);
    border: 2px solid var(--line-color);
    color: var(--line-dark);
    padding: 12px 20px;
    font-weight: 700;
    border-radius: 12px;
    margin-bottom: 5px;
    width: 80%;
    text-align: center;
    z-index: 2;
}

.process-box {
    background: var(--box-bg);
    border: 2px solid #cbd5e1;
    border-left: 5px solid var(--line-color);
    padding: 18px;
    margin: 15px 0;
    width: 80%;
    text-align: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s;
}

.process-box:hover {
    transform: translateY(-2px);
    border-color: var(--line-color);
}

.process-box.final-box {
    border: 2px solid var(--line-dark);
    background: var(--decision-bg);
    color: var(--line-dark);
    font-weight: 800;
}

.arrow-down {
    width: 0;
    height: 30px;
    border-left: 3px solid var(--line-dark);
    position: relative;
    margin: -2px 0;
    z-index: 1;
    opacity: 0.8;
}

.arrow-down::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--line-dark);
}

.process-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.loop-line {
    position: absolute;
    top: 60px;
    bottom: 130px;
    left: -25px;
    width: 50%;
    border-left: 5px solid var(--line-dark);
    border-top: 5px solid var(--line-dark);
    border-bottom: 5px solid var(--line-dark);
    border-radius: 30px 0 0 30px;
    z-index: 0;
    opacity: 0.8;
}

.loop-line::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid var(--line-dark);
}

.connector-area {
    position: relative;
    pointer-events: none;
}

svg {
    overflow: visible;
}

@media (max-width: 768px) {
    .flow-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .connector-area {
        display: none;
    }

    .right-col::before {
        content: '⬇ SE ESTIVER CORRETO ⬇';
        font-weight: bold;
        color: var(--line-dark);
        margin-bottom: 20px;
    }
}

@media print {
    .top-nav {
        display: none;
    }

    .diagram-area {
        margin: 0;
        box-shadow: none;
        width: 100%;
        border: none;
        background: white;
    }

    body {
        background: white;
    }
}
