/* ═══════════════════════════════════════════════════════
   AGENDA + CANCELAMENTO — style.css
═══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue1: #0975b5;
    --blue2: #0099da;
    --cyan: #01b1ec;
    --green: #59be2c;
    --red: #e03535;
    --red-dk: #b91c1c;
    --city-gradient: linear-gradient(90deg, green, orange, blue);

    --text-dark: #1a2e44;
    --text-mid: #4a6070;
    --text-light: #7a9099;
    --border: #e2e8f0;
    --bg-field: #f8fafc;

    --radius-card: 18px;
    --radius-field: 10px;
    --shadow-card: 0 8px 40px rgba(0, 0, 0, .10);
    --transition: .24s cubic-bezier(.4, 0, .2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f4f8;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 0, 0, .28), rgba(0, 0, 0, .28)),
        url("assets/bg.png") no-repeat center/cover;
    transform: scale(1.1);
    filter: blur(10px);
    z-index: -1;
}

/* ── HEADER ── */
header {
    background-image: url('assets/bg-header.png');
    background-size: cover;
    background-position: 55px -250px;
    padding: 0 clamp(20px, 5vw, 60px);
    position: relative;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .12);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 80px;
}

.logo {
    height: 58px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .12));
    flex-shrink: 0;
}

.header-text h1 {
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.header-text p {
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 500;
    color: var(--blue1);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-stripe {
    height: 4px;
    width: calc(100% + clamp(20px, 5vw, 60px) * 2);

    margin-left: calc(clamp(20px, 5vw, 60px) * -1);

    background: var(--city-gradient);
}

/* ── MAIN ── */
main {
    flex: 1;
    padding: clamp(24px, 4vw, 40px) clamp(16px, 5vw, 60px) 60px;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
}

/* ── ABAS ── */
.tabs-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 6px;
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .65);
    background: transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.tab svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    transition: stroke var(--transition);
}

.tab.active[data-tab="agenda"] {
    background: var(--blue1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(9, 117, 181, .45);
}

.tab.active[data-tab="cancel"] {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(224, 53, 53, .45);
}

.tab:not(.active):hover {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .9);
}

/* ── VIEWS ── */
.view-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition), transform var(--transition);
}

.view-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ── PAGE TITLE ── */
.page-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.page-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue {
    background: linear-gradient(135deg, var(--blue1), var(--cyan));
    box-shadow: 0 4px 14px rgba(1, 177, 236, .35);
}

.icon-red {
    background: linear-gradient(135deg, var(--red-dk), var(--red));
    box-shadow: 0 4px 14px rgba(224, 53, 53, .35);
}

.icon-green {
    background: linear-gradient(135deg, #3da81a, var(--green));
    box-shadow: 0 4px 14px rgba(89, 190, 44, .35);
}

.page-icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page-title h2 {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.page-title p {
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
    margin-top: 2px;
}

/* ── FORM (Carregamento) ── */
form#formCarregaDocumentos {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.form-section {
    padding: 32px 36px;
}

.form-section:first-child {
    border-right: 1px solid var(--border);
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--blue1);
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

/* campo genérico */
.field-group {
    margin-bottom: 16px;
}

.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
    letter-spacing: .4px;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-field);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-field);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--blue2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 153, 218, .12);
}

.field-group textarea {
    resize: vertical;
    min-height: 90px;
}

.field-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a6070' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* form footer */
.form-footer {
    padding: 20px 36px 28px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

/* botão carregar */
button[type="submit"]#btnCarregar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-field);
    background: var(--blue1);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    box-shadow: 0 4px 18px rgba(9, 117, 181, .30);
}

button[type="submit"]#btnCarregar svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

button[type="submit"]#btnCarregar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(9, 117, 181, .40);
}

button[type="submit"]#btnCarregar:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── SUCCESS (Carregar) ── */
.success-msg {
    background: rgba(255, 255, 255, .95);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 48px 32px;
    text-align: center;
    margin-top: 8px;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 34px;
    height: 34px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-msg h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.success-msg p {
    font-size: 14px;
    color: var(--text-mid);
    max-width: 340px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.btn-novo {
    padding: 11px 28px;
    border: 2px solid var(--blue1);
    border-radius: var(--radius-field);
    background: transparent;
    color: var(--blue1);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.btn-novo:hover {
    background: var(--blue1);
    color: #fff;
}

/* ── CANCELAMENTO CARD ── */
.cancel-card {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 36px;
    max-width: 520px;
    margin: 0 auto;
}

/* info box */
.cancel-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius-field);
    padding: 13px 16px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.55;
    margin-bottom: 24px;
}

.cancel-info svg {
    width: 18px;
    height: 18px;
    stroke: #3b82f6;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    margin-top: 1px;
}

/* campo protocolo foco vermelho */
#panelCancel .field-group input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(224, 53, 53, .12);
}

/* botão cancelar */
button[type="submit"]#btnCancelar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 4px;
    border: none;
    border-radius: var(--radius-field);
    background: linear-gradient(135deg, var(--red-dk), var(--red));
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 18px rgba(224, 53, 53, .30);
}

button[type="submit"]#btnCancelar svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

button[type="submit"]#btnCancelar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(224, 53, 53, .42);
}

button[type="submit"]#btnCancelar:active {
    transform: scale(.98);
}

/* feedback cancelamento */
.feedback-cancel {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-field);
    font-size: 14px;
    font-weight: 600;
    max-width: 520px;
}

.feedback-cancel.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
}

.feedback-cancel.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1.5px solid #fecaca;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (min-width: 900px) {
    .header-text {
        margin-left: 790px;
    }
}

@media (max-width: 700px) {
    .header-text {
        margin-left: 60px;
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .header-text h1 {
        font-size: 11px;
    }

    .header-text p {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .tabs-wrapper {
        gap: 6px;
    }

    .tab {
        font-size: 13px;
        padding: 10px 10px;
        gap: 6px;
    }

    .tab svg {
        width: 14px;
        height: 14px;
    }

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

    .form-section {
        padding: 24px 20px;
    }

    .form-section:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .form-footer {
        padding: 18px 20px 24px;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    main {
        padding: 20px 16px 48px;
    }

    .page-title h2 {
        font-size: 16px;
    }

    .page-title p {
        font-size: 12px;
    }

    .cancel-card {
        padding: 24px 20px;
    }
}
