/* ==========================================================
   SÓ SOFÁ T-63 — Admin Panel CSS
   Inherits design system: Playfair Display + DM Sans
   Palette: Charcoal dark bg · Ivory · Gold · Blue brand
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    /* Brand */
    --blue: #2C4393;
    --blue-mid: #3A56B8;
    --blue-pale: #E8EDF8;
    --gold: #B8902A;
    --gold-light: #D4AB4E;
    --gold-pale: #F0E4C4;
    --rust: #C0392B;
    --rust-dark: #96251F;

    /* Neutrals */
    --charcoal: #1C1C1C;
    --charcoal-mid: #2A2A2A;
    --charcoal-soft: #5A5A5A;
    --ivory: #F5F0E8;
    --ivory-dark: #EDE5D5;
    --cream: #FAF7F2;
    --white: #FFFFFF;

    /* Glass surface on dark */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.10);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    --radius-sm: 6px;
    --radius-md: 14px;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.28);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

/* --- Body: deep dark bg with brand diagonal --- */
body {
    font-family: var(--font-body);
    color: var(--ivory);
    min-height: 100vh;
    background-color: var(--charcoal);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(44, 67, 147, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(184, 144, 42, 0.18) 0%, transparent 50%),
        repeating-linear-gradient(-45deg,
            transparent,
            transparent 48px,
            rgba(255, 255, 255, 0.015) 48px,
            rgba(255, 255, 255, 0.015) 49px);
    background-attachment: fixed;
}

/* Login page: center content */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* --- Container --- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Glass card --- */
.glass-dark {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Gold top line accent on glass cards */
.glass-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--gold));
}

/* --- Logo --- */
img.site-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

/* --- Login card --- */
.login-container {
    width: 100%;
    max-width: 420px;
}

.login-container p {
    font-size: .9rem;
    color: rgba(245, 240, 232, 0.60);
    margin-bottom: 2rem;
    letter-spacing: .04em;
}

/* Login eyebrow */
.login-container::after {
    content: 'ÁREA RESTRITA';
    display: block;
    text-align: center;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .18em;
    color: rgba(184, 144, 42, .55);
    margin-bottom: 1.5rem;
}

/* --- Form inputs --- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: .9rem 1.1rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: .95rem;
    outline: none;
    transition: border-color .25s ease, background .25s ease;
}

input::placeholder {
    color: rgba(245, 240, 232, 0.35);
}

input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(184, 144, 42, 0.18);
}

/* --- Buttons --- */
.submit-btn {
    width: 100%;
    padding: .95rem;
    background: var(--blue);
    color: var(--ivory);
    border: 1.5px solid var(--blue-mid);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .3s var(--ease-out);
    margin-top: .25rem;
}

.submit-btn:hover {
    background: var(--blue-mid);
    box-shadow: 0 8px 24px rgba(44, 67, 147, .40);
    transform: translateY(-2px);
}

/* --- Messages --- */
.error-msg {
    color: #ff8888;
    margin-top: .75rem;
    font-size: .88rem;
}

.status-msg {
    margin-top: .75rem;
    font-size: .9rem;
    font-weight: 500;
}

.success-msg {
    color: #6ee097;
}

/* =====================
   DASHBOARD
   ===================== */

/* Admin header bar */
.admin-header {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.25);
    color: rgba(245, 240, 232, 0.75);
    padding: .5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .25s ease;
}

.logout-btn:hover {
    background: rgba(192, 57, 43, 0.20);
    border-color: var(--rust);
    color: #ffaaaa;
}

/* Admin main area */
.admin-main {
    padding-top: 3rem;
    padding-bottom: 4rem;
    max-width: 860px;
}

/* Panel headings */
.admin-panel h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ivory);
    margin-bottom: .5rem;
}

.admin-panel>p {
    color: rgba(245, 240, 232, 0.55);
    font-size: .9rem;
    margin-bottom: 2rem;
}

/* Upload form layout */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

/* File drop area */
.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    border: 1.5px dashed rgba(184, 144, 42, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    transition: all .25s ease;
    cursor: pointer;
}

.file-drop-area:hover,
.file-drop-area.is-active {
    background: rgba(184, 144, 42, 0.07);
    border-color: var(--gold);
}

.fake-btn {
    background: rgba(184, 144, 42, 0.18);
    border: 1px solid rgba(184, 144, 42, 0.35);
    color: var(--gold-light);
    padding: .45rem 1.25rem;
    border-radius: 3px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .75rem;
    pointer-events: none;
}

.file-msg {
    font-size: .85rem;
    color: rgba(245, 240, 232, 0.45);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Caption input inside upload form */
.text-input {
    width: 100%;
    padding: .9rem 1.1rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: .95rem;
    outline: none;
    transition: border-color .25s ease, background .25s ease;
}

.text-input::placeholder {
    color: rgba(245, 240, 232, 0.35);
}

.text-input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(184, 144, 42, 0.18);
}

/* Upload button — gold accent to differ from login */
#uploadBtn {
    background: var(--gold);
    border-color: var(--gold-light);
    color: var(--charcoal);
    font-weight: 700;
}

#uploadBtn:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    box-shadow: 0 8px 24px rgba(184, 144, 42, .35);
}

/* --- Gallery management list --- */
.admin-gallery-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    text-align: left;
    margin-top: 1.5rem;
}

.admin-gallery-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.20);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: .875rem 1.1rem;
    transition: background .2s ease, border-color .2s ease;
}

.admin-gallery-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(184, 144, 42, 0.30);
}

.admin-gallery-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
}

.admin-gallery-info img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.img-title {
    font-size: .9rem;
    color: rgba(245, 240, 232, 0.80);
    font-weight: 400;
}

.admin-gallery-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.action-btn {
    padding: .45rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .2s ease;
}

.btn-edit {
    background: rgba(44, 67, 147, 0.30);
    border: 1px solid rgba(58, 86, 184, 0.50);
    color: #a8bdf0;
}

.btn-edit:hover {
    background: var(--blue);
    color: var(--ivory);
    border-color: var(--blue);
}

.btn-delete {
    background: rgba(192, 57, 43, 0.25);
    border: 1px solid rgba(192, 57, 43, 0.45);
    color: #ffaaaa;
}

.btn-delete:hover {
    background: var(--rust);
    color: var(--white);
    border-color: var(--rust);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .glass-dark {
        padding: 2rem 1.5rem;
    }

    .admin-gallery-item {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }

    .admin-gallery-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .action-btn {
        flex: 1;
        text-align: center;
    }
}