@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Raleway:wght@400;500;600;700&display=swap");

* {
    box-sizing: border-box;
}

:root {
    --green: #183c2c;
    --green-dark: #0d2119;
    --gold: #c6a451;
    --cream: #f6f3ed;
    --paper: #eeeae1;
    --text: #17231d;
    --muted: #69726d;
    --border: #d9d4c9;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--text);
    font-family: "Raleway", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   LOGIN
========================= */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 42px;
    background: #fff;
    border: 1px solid var(--border);
}

.admin-brand {
    color: var(--green);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.admin-brand span {
    color: var(--gold);
}

.auth-card h1,
.admin-title h1 {
    margin: 28px 0 8px;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 40px;
    line-height: 1.1;
}

.auth-card p,
.admin-title p {
    color: var(--muted);
}

.auth-card form,
.editor-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

/* =========================
   CAMPOS
========================= */

label {
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #ccc6b9;
    font: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #c6a45155;
    border-color: var(--gold);
}

.message {
    min-height: 20px;
    color: #8b3b2e;
    font-size: 13px;
}

/* =========================
   BOTÕES GERAIS
========================= */

button,
.primary,
.secondary {
    cursor: pointer;
    padding: 12px 18px;
    font-family: "Raleway", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-card button,
.primary {
    color: #fff;
    background: var(--green);
    border: 0;
}

.secondary {
    color: var(--green);
    background: transparent;
    border: 1px solid #bdb6a7;
}

/* =========================
   HEADER
========================= */

.admin-header {
    min-height: 74px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #ddd8cd;
}

.admin-header > div {
    display: flex;
    gap: 8px;
}

/* =========================
   CONTEÚDO
========================= */

.admin-main,
.editor-main {
    width: min(1180px, 92vw);
    margin: 55px auto;
}

.editor-main {
    max-width: 900px;
}

.admin-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 35px;
}

.admin-title small {
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.2em;
}

.admin-title h1 {
    margin: 7px 0;
}

/* =========================
   TABELAS
========================= */

.table-wrap {
    overflow: auto;
    background: #fff;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid #eee9df;
    font-size: 13px;
}

th {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status {
    padding: 6px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status.published {
    color: #28543d;
    background: #e7efe9;
}

.status.draft {
    color: #776f62;
    background: var(--paper);
}

/* =========================
   AÇÕES
========================= */

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

.actions a,
.actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 34px;
    padding: 0 12px;

    font-family: "Raleway", sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;

    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;

    transition:
        color 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.actions a {
    color: var(--green);
}

.actions button {
    color: #9a3e31;
}

.actions a:hover {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.actions button:hover {
    color: #fff;
    background: #9a3e31;
    border-color: #9a3e31;
}

/* =========================
   EDITOR
========================= */

.editor-form {
    padding: 35px;
    background: #fff;
    border: 1px solid var(--border);
}

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

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 10px;
}

/* =========================
   FORMULÁRIO DE CURSOS
========================= */

.admin-form {
    width: 100%;
    max-width: 900px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-group label {
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 14px 16px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0;
    font-family: "Raleway", sans-serif;
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.form-group input {
    height: 48px;
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9a9f9b;
}

.form-group small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

/* =========================
   CAMPOS LADO A LADO
========================= */

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

/* =========================
   OPÇÕES
========================= */

.form-options {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 8px 0 35px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--green);
}

/* =========================
   IMAGEM
========================= */

.image-preview {
    width: 260px;
    max-width: 100%;
    margin-top: 15px;
}

.image-preview img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* =========================
   ABAS
========================= */

.admin-tabs {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 42px;
    border-bottom: 1px solid var(--border);
}

.admin-tabs a {
    position: relative;
    display: inline-block;
    padding-bottom: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color 0.25s ease;
}

.admin-tabs a:hover,
.admin-tabs a.active {
    color: var(--green);
}

.admin-tabs a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--gold);
}

/* =========================
   SEÇÕES
========================= */

.admin-section {
    margin-bottom: 80px;
}

.admin-courses-section {
    padding-top: 50px;
    border-top: 1px solid var(--border);
}

.admin-section .admin-title {
    margin-bottom: 28px;
}

#courseMessage {
    margin-bottom: 25px;
}

/* =========================
   CALENDÁRIO
========================= */

.custom-date-picker {
    position: relative;
    width: 100%;
}

.date-picker-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    padding: 0 16px;

    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);

    font-family: "Raleway", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-transform: none;

    cursor: pointer;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.date-picker-button:hover {
    border-color: var(--green);
}

.date-picker-button:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

#datePickerText {
    text-transform: lowercase;
}

.date-picker-arrow {
    flex-shrink: 0;
    color: var(--gold);
    font-size: 20px;
    line-height: 1;
}

.calendar {
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-width: 100%;
    padding: 18px;

    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    margin-bottom: 18px;
}

.calendar-header strong {
    min-width: 0;
    overflow: hidden;

    color: var(--green);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-transform: lowercase;
    white-space: nowrap;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;

    color: var(--green);
    background: transparent;
    border: 0;

    font-family: Arial, sans-serif;
    font-size: 23px;
    line-height: 1;
    text-transform: none;

    cursor: pointer;
}

.calendar-nav:hover {
    color: #fff;
    background: var(--green);
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-weekdays span {
    min-width: 0;
    overflow: hidden;

    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    text-align: center;
    text-transform: lowercase;
}

.calendar-days {
    gap: 4px;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 1;

    padding: 0;
    margin: 0;

    color: var(--text);
    background: transparent;
    border: 0;

    font-family: "Raleway", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-transform: none;

    cursor: pointer;
}

.calendar-day:hover {
    color: #fff;
    background: var(--green);
}

.calendar-day.other-month {
    color: #c5c8c5;
}

.calendar-day.today {
    color: var(--gold);
    font-weight: 700;
}

.calendar-day.selected {
    color: #fff;
    background: var(--green);
}

.calendar-clear {
    width: 100%;
    margin-top: 16px;
    padding: 14px 0 0;

    color: var(--green);
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: lowercase;

    cursor: pointer;
}

.calendar-clear:hover {
    color: var(--gold);
}

/* =========================
   RESPONSIVIDADE
========================= */

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

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .form-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .admin-section {
        margin-bottom: 55px;
    }

    .admin-courses-section {
        padding-top: 35px;
    }

    .admin-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .editor-form,
    .auth-card {
        padding: 24px;
    }

    .admin-header {
        padding: 15px 4vw;
        gap: 12px;
    }

    .admin-header > div {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .calendar {
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 380px) {
    .calendar {
        padding: 12px;
    }

    .calendar-days {
        gap: 2px;
    }

    .calendar-weekdays {
        margin-bottom: 6px;
    }

    .calendar-weekdays span {
        font-size: 7px;
        letter-spacing: 0;
    }

    .calendar-day {
        font-size: 10px;
    }

    .calendar-header {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
    }

    .calendar-header strong {
        font-size: 19px;
    }

    .calendar-nav {
        width: 30px;
        height: 30px;
        font-size: 21px;
    }
}