/*
 * Rosetta Guest Portal — stylesheet
 *
 * Brand palette pulled from the official Rosetta branding PDF:
 *   --rosetta-tan:    #dbac6d   (primary brand color)
 *   --rosetta-brown:  #786a65   (secondary/text)
 *   --rosetta-sage:   #d3dfc2   (accent)
 *   --rosetta-sky:    #c4dfe8   (accent)
 *
 * No external fonts — system fonts only. This avoids the captive portal
 * trying to fetch from a CDN before the user has Internet access.
 */

:root {
    --rosetta-tan:    #dbac6d;
    --rosetta-tan-dark: #c5965a;
    --rosetta-brown:  #786a65;
    --rosetta-brown-dark: #5a4f4b;
    --rosetta-sage:   #d3dfc2;
    --rosetta-sky:    #c4dfe8;
    --rosetta-cream:  #f7f2ea;
    --rosetta-white:  #ffffff;

    --text-primary: #2c2826;
    --text-muted: #6b625e;
    --error: #b3261e;
    --success: #2e7d32;
    --border: #e5dfd6;

    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(120, 106, 101, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--rosetta-cream) 0%, var(--rosetta-sage) 100%);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--rosetta-brown-dark); }
a:hover { color: var(--rosetta-tan-dark); }

.shell {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.75rem 1rem 0.75rem;
}

.card {
    width: 100%;
    max-width: 440px;
    background: var(--rosetta-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

.brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-logo {
    display: block;
    width: 220px;
    max-width: 82%;
    height: auto;
    margin: 0 auto 1.15rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rosetta-brown-dark);
    margin: 0 0 0.25rem 0;
    line-height: 1.15;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 420px) {
    .card {
        padding: 1.5rem;
    }

    .brand-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 360px) {
    .brand-title {
        font-size: 0.95rem;
    }
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.tab {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: var(--rosetta-brown-dark); }

.tab.active {
    color: var(--rosetta-tan-dark);
    border-bottom-color: var(--rosetta-tan);
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--rosetta-white);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    outline: none;
    border-color: var(--rosetta-tan);
    box-shadow: 0 0 0 3px rgba(219, 172, 109, 0.2);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    text-align: center;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--rosetta-tan);
    color: var(--rosetta-white);
}
.btn-primary:hover:not(:disabled) { background: var(--rosetta-tan-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
    background: var(--rosetta-white);
    color: var(--rosetta-brown-dark);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.btn-secondary:hover { background: var(--rosetta-cream); }

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: var(--rosetta-white);
    color: var(--text-primary);
}

.btn-social svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.btn-social span {
    min-width: 0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.divider span { padding: 0 0.75rem; }

.notice {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.notice-error { background: #fdecea; color: var(--error); }
.notice-success { background: #e8f5e9; color: var(--success); }
.notice-info { background: var(--rosetta-sky); color: var(--rosetta-brown-dark); }

.policy-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.footer {
    width: 100%;
    max-width: 440px;
    margin: 0.35rem auto 2.5rem;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.footer a { color: var(--rosetta-brown-dark); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    min-width: 0;
}

.footer-follow,
.footer-site {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.footer-follow span {
    font-weight: 600;
    color: var(--rosetta-brown-dark);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    color: var(--rosetta-brown-dark);
}

.social-link:hover {
    color: var(--rosetta-tan-dark);
    text-decoration: none;
}

.social-link svg {
    display: block;
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.powered-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-decoration: none;
    line-height: 1;
    flex: 0 0 auto;
}

.powered-badge span {
    white-space: nowrap;
}

.powered-badge a {
    display: block;
    line-height: 1;
}

.powered-badge a:hover {
    text-decoration: none;
}

.powered-badge a > img.powered-badge-logo {
    display: block;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
}

@media (max-width: 520px) {
    .footer {
        padding: 0 1.25rem;
    }

    .powered-badge span {
        display: none;
    }
}

.hidden { display: none !important; }

/* ===== Admin styles ===== */
.admin-shell {
    min-height: 100vh;
    background: var(--rosetta-cream);
}

.admin-header {
    background: var(--rosetta-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--rosetta-brown-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.admin-header-logo {
    display: block;
    width: 124px;
    height: auto;
    flex: 0 1 auto;
}

.admin-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-header-actions button {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--rosetta-brown-dark);
}
.admin-header-actions button:hover { background: var(--rosetta-cream); }

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--rosetta-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--rosetta-tan);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rosetta-brown-dark);
    margin-top: 0.25rem;
}

.panel {
    background: var(--rosetta-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rosetta-brown-dark);
    margin: 0;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filters select, .filters input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--rosetta-white);
}

.filters button {
    padding: 0.4rem 0.85rem;
    background: var(--rosetta-tan);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
}
.filters button:hover { background: var(--rosetta-tan-dark); }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    background: var(--rosetta-cream);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

table.data td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

table.data tr:hover td { background: var(--rosetta-cream); }

.pager {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pager button {
    padding: 0.35rem 0.75rem;
    background: var(--rosetta-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}
.pager button:disabled { opacity: 0.5; cursor: not-allowed; }
.pager button:hover:not(:disabled) { background: var(--rosetta-cream); }

.empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
