:root {
    --bg: #f2f4f7;
    --panel: #ffffff;
    --ink: #18202c;
    --muted: #687385;
    --line: #dfe4eb;
    --accent: #2367d1;
    --accent-dark: #164c9f;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI", sans-serif;
    line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: var(--accent);
    font-weight: 700;
    cursor: pointer;
}
button:hover { background: var(--accent-dark); }
label { display: grid; gap: 7px; color: #3c4655; font-size: .88rem; font-weight: 700; }
input, textarea, select {
    width: 100%;
    padding: 11px 12px;
    color: var(--ink);
    background: white;
    border: 1px solid #cdd5df;
    border-radius: 8px;
    outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35, 103, 209, .12); }
textarea { resize: vertical; }

.auth-shell {
    min-height: 100vh;
    background: #f5f6f7;
}
.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
}
.auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: clamp(34px, 5vw, 74px);
    color: white;
    background:
        linear-gradient(90deg, rgba(20, 22, 24, .94), rgba(20, 22, 24, .3)),
        url("../imgs/generated/banner-principal-estudio-criativo-v1.png") center / cover;
}
.auth-visual small { color: #d8dade; }
.auth-side {
    display: grid;
    place-items: center;
    padding: clamp(32px, 6vw, 90px);
}
.auth-card {
    width: min(100%, 480px);
    display: grid;
    gap: 17px;
}
.auth-brand {
    display: inline-flex;
    width: fit-content;
}
.auth-brand img {
    display: block;
    width: min(190px, 52vw);
    height: auto;
}
.auth-statement { max-width: 680px; }
.auth-statement h2 {
    margin: 0 0 22px;
    font-size: clamp(2.7rem, 5vw, 5.5rem);
    line-height: .98;
    letter-spacing: -.055em;
}
.auth-statement h2 em { color: #f15a29; font-style: normal; }
.auth-statement p {
    max-width: 560px;
    margin: 0;
    color: #d8dade;
    line-height: 1.7;
}
.auth-heading { display: grid; gap: 12px; margin-bottom: 12px; }
.auth-heading > span {
    width: fit-content;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    color: #f15a29;
    background: #e1e4e7;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.auth-card h1,
.auth-card p { margin: 0; }
.auth-card h1 {
    font-size: clamp(2.15rem, 4vw, 4rem);
    line-height: 1.02;
    letter-spacing: -.045em;
}
.auth-card p { color: #6f747a; line-height: 1.65; }
.auth-card label {
    color: #3c4655;
    font-size: .83rem;
}
.auth-field { position: relative; display: flex; align-items: center; }
.auth-card input {
    height: 56px;
    padding: 0 18px;
    color: #1f2124;
    background: white;
    border-color: #d4d7da;
    border-radius: 14px;
}
.auth-card input:focus {
    border-color: #f15a29;
    box-shadow: 0 0 0 4px rgba(241, 90, 41, .15);
}
.auth-submit {
    height: 56px;
    margin-top: 4px;
    color: #f15a29;
    background: #fff;
    border: 2px solid #f15a29;
    border-radius: 999px;
    box-shadow: none;
    transform: none;
    transition:
        color .3s ease,
        background-color .3s ease,
        border-color .3s ease,
        box-shadow .3s ease;
}
.auth-submit span {
    color: inherit;
}
.auth-submit-normal {
    opacity: 1;
}
.auth-submit-hover {
    display: none;
}
.auth-submit:hover,
.auth-submit:focus-visible {
    color: #fff;
    background: #f15a29;
    border-color: #f15a29;
    transform: none;
    box-shadow: 0 0 0 7px rgba(241, 90, 41, .14);
}
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 2px;
    color: #6f747a;
    font-size: .8rem;
}
.back-link {
    color: inherit;
    text-decoration: none;
}
.back-link::before { content: "\2190\00a0"; }
.back-link:hover { color: #f15a29; }
.auth-card .notice { margin: 0; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    color: white;
    background: #111827;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.sidebar-brand span { display: grid; width: 38px; height: 38px; place-items: center; background: var(--accent); border-radius: 9px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
    padding: 11px 12px;
    color: #aeb8c7;
    border-radius: 8px;
    text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: #222d3e; }
.sidebar form { margin-top: auto; }
.logout { width: 100%; color: #bdc6d4; background: transparent; border: 1px solid #344054; }

.admin-main { min-width: 0; padding: 36px clamp(20px, 4vw, 56px) 80px; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.page-header span { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.page-header h1 { margin: 4px 0 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.panel-form { display: grid; gap: 22px; }
.form-section, .upload-panel {
    padding: 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.form-section h2 { margin: 0 0 22px; font-size: 1.15rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-grid .wide { grid-column: 1 / -1; }
.services-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
fieldset { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 8px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.mobile-save { display: none; }

.notice { margin-bottom: 22px; padding: 13px 16px; border-radius: 8px; font-weight: 700; }
.notice.success { color: #067647; background: #ecfdf3; border: 1px solid #abefc6; }
.notice.error { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; }

.upload-panel form { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; align-items: end; }
.upload-panel p { margin: 14px 0 0; color: var(--muted); font-size: .85rem; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.media-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 12px; }
.media-card > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e9edf3; }
.media-card > div { display: grid; gap: 7px; padding: 15px; }
.media-card span { color: var(--accent); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.media-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card small { color: var(--muted); }
.media-card form { margin-top: 7px; }
.danger { min-height: 36px; color: var(--danger); background: transparent; border: 1px solid #fecdca; }
.danger:hover { color: white; background: var(--danger); }
.empty-admin { grid-column: 1 / -1; padding: 60px; color: var(--muted); text-align: center; background: white; border: 1px dashed #cdd5df; border-radius: 12px; }
.security-card { max-width: 600px; }
.security-card form { display: grid; gap: 18px; }

@media (max-width: 980px) {
    .media-grid { grid-template-columns: 1fr 1fr; }
    .upload-panel form { grid-template-columns: 1fr 1fr; }
    .upload-panel button { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-visual { min-height: 42vh; gap: 70px; }
    .auth-statement h2 { font-size: clamp(2.5rem, 12vw, 4.4rem); }
    .auth-side { padding: 46px 24px 64px; }
    .admin-layout { display: block; }
    .sidebar { position: static; height: auto; }
    .sidebar nav { grid-template-columns: 1fr 1fr; }
    .sidebar form { margin-top: 18px; }
    .admin-main { padding: 26px 16px 60px; }
    .page-header > button { display: none; }
    .field-grid, .services-editor, .media-grid, .upload-panel form { grid-template-columns: 1fr; }
    .upload-panel button { grid-column: auto; }
    .mobile-save { display: block; }
}
