html {
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color, #f4f4f2);
    background-image: var(--background-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color, #222222);
}

.portal-container,
.terms-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 48px 20px;
}

.terms-container {
    max-width: 900px;
}

.logo-container {
    text-align: center;
    margin-bottom: 26px;
}

.hotel-logo {
    display: inline-block;
    width: auto;
    max-width: 220px;
    max-height: 180px;
}

.portal-card {
    background: var(--box-color, #ffffff);
    color: var(--text-color, #222222);
    border-radius: 12px;
    padding: 34px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
}

    .portal-card h1,
    .portal-card h2 {
        color: var(--header-color, #222222);
    }

    .portal-card h1 {
        margin: 0 0 12px 0;
        text-align: center;
        font-size: 2rem;
        font-weight: 600;
    }

    .portal-card h2 {
        margin-top: 32px;
        margin-bottom: 10px;
        font-size: 1.25rem;
    }

.intro {
    margin: 0 0 30px 0;
    text-align: center;
    line-height: 1.5;
    opacity: 0.8;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-field {
    margin-bottom: 20px;
}

    .form-field label {
        display: block;
        margin-bottom: 7px;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .form-field input {
        width: 100%;
        padding: 13px 14px;
        border: 1px solid #c9c9c9;
        border-radius: 6px;
        font-family: inherit;
        font-size: 1rem;
        background: #ffffff;
        color: #222222;
    }

        .form-field input:focus {
            outline: none;
            border-color: var(--button-color, #555555);
            box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
        }

.terms-field {
    margin: 4px 0 22px 0;
}

.terms-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.4;
}

    .terms-checkbox input {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin-top: 2px;
    }

a {
    color: var(--link-color, #444444);
}

.connect-button {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 15px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--button-color, #222222);
    color: var(--button-text-color, #ffffff);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

    .connect-button:hover {
        filter: brightness(90%);
    }

.field-validation {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #b00020;
}

.validation-summary {
    margin-bottom: 20px;
    color: #b00020;
}

    .validation-summary ul {
        margin: 0;
        padding-left: 20px;
    }

.success-card {
    text-align: center;
}

.success-icon {
    display: flex;
    width: 64px;
    height: 64px;
    margin: 0 auto 22px auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--button-color, #222222);
    color: var(--button-text-color, #ffffff);
    font-size: 2rem;
    font-weight: bold;
}

.continue-button {
    margin-top: 24px;
}

.terms-card {
    line-height: 1.55;
}

    .terms-card p {
        margin: 0 0 18px 0;
    }

    .terms-card li {
        margin-bottom: 12px;
    }

@media (max-width: 600px) {

    .portal-container,
    .terms-container {
        padding: 22px 14px 36px 14px;
    }

    .portal-card {
        padding: 26px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hotel-logo {
        max-width: 180px;
    }
}
.admin-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 32px 24px 60px 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

    .admin-header h1 {
        margin: 0;
    }

.admin-subtitle {
    margin-top: 6px;
    color: #666;
}

.admin-filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
    gap: 16px;
    align-items: end;
}

    .admin-filters select {
        width: 100%;
        padding: 13px 14px;
        border: 1px solid #c9c9c9;
        border-radius: 6px;
        background: #fff;
        font: inherit;
    }

.admin-filter-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 20px 0;
}

.admin-primary-button,
.admin-secondary-button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.admin-primary-button {
    background: #222;
    color: #fff;
}

.admin-secondary-button {
    background: #e7e7e7;
    color: #222;
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        border-bottom: 1px solid #ddd;
        text-align: left;
        white-space: nowrap;
    }

    .admin-table th {
        background: #f2f2f2;
        font-weight: 600;
    }

    .admin-table tbody tr:hover {
        background: #fafafa;
    }

.admin-empty {
    padding: 30px !important;
    text-align: center !important;
    color: #777;
}

@media (max-width: 900px) {

    .admin-filters {
        grid-template-columns: 1fr;
    }

    .admin-filter-buttons {
        margin-bottom: 0;
    }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.color-editor {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: center;
}

.color-picker {
    width: 72px;
    height: 42px;
    padding: 2px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

    .color-picker::-webkit-color-swatch-wrapper {
        padding: 2px;
    }

    .color-picker::-webkit-color-swatch {
        border: none;
        border-radius: 4px;
    }

    .color-picker::-moz-color-swatch {
        border: none;
        border-radius: 4px;
    }

.color-hex {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.group-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 28px;
    align-items: start;
}

.portal-preview-wrapper {
    position: sticky;
    top: 24px;
}

.portal-preview-title {
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.portal-preview {
    padding: 26px;
    border: 1px solid #ddd;
    border-radius: 12px;
    min-height: 620px;
    background: #f4f4f4;
}

.preview-logo {
    text-align: center;
    margin-bottom: 20px;
}

    .preview-logo img {
        max-width: 180px;
        max-height: 120px;
    }

.preview-card {
    padding: 26px;
    border-radius: 12px;
    background: #fff;
    color: #222;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

    .preview-card h2 {
        margin-top: 0;
        text-align: center;
    }

    .preview-card p {
        text-align: center;
        line-height: 1.4;
    }

    .preview-card input[type="text"],
    .preview-card input[type="password"] {
        width: 100%;
        padding: 10px 11px;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background: #fff;
    }

.preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preview-terms {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 8px 0 16px 0;
    font-size: 0.85rem;
}

.preview-card button {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 6px;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .group-edit-layout {
        grid-template-columns: 1fr;
    }

    .portal-preview-wrapper {
        position: static;
    }
}

.current-asset {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f7f7f7;
    text-align: center;
}

.current-logo {
    max-width: 180px;
    max-height: 110px;
    object-fit: contain;
}

.current-background {
    width: 100%;
    max-width: 260px;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.preview-logo img {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
}


/* Group Terms editor and guest Terms use the existing portal typography and colors. */
.terms-editor { min-width: 0; }
.terms-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 6px 6px 0 0;
    background: #f4f4f4;
}
.terms-toolbar[hidden], .terms-editor [hidden] { display: none; }
.terms-toolbar button {
    width: auto;
    padding: 6px 10px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #222;
    cursor: pointer;
    font: inherit;
}
.terms-toolbar button:disabled { opacity: .5; cursor: default; }
.terms-toolbar button:focus-visible, #terms-visual:focus-visible {
    outline: 2px solid #245fa5;
    outline-offset: 2px;
}
#terms-visual, .terms-editor textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 320px;
    max-height: 650px;
    overflow: auto;
    padding: 16px;
    border: 1px solid #bbb;
    border-radius: 0 0 6px 6px;
    background: #fff;
    color: #222;
    line-height: 1.6;
}
.terms-editor textarea { font-family: ui-monospace, monospace; resize: vertical; }
.terms-content { overflow-wrap: anywhere; }
.terms-content p, .terms-content ul, .terms-content ol { margin: 0 0 1em; }
.terms-content h2, .terms-content h3, .terms-content h4 { margin: 1em 0 .5em; }
.terms-content ul, .terms-content ol { padding-left: 1.8em; }
.terms-content blockquote { border-left: 3px solid #aaa; padding-left: 1em; margin-left: 0; }
.terms-content table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.terms-content th, .terms-content td { border: 1px solid #aaa; padding: .4em; }
.terms-version, #terms-editor-help, #terms-editor-status { font-size: .9rem; }


.access-group-options {
    display: grid;
    gap: 12px;
    padding: 16px;
    margin: 0 0 20px;
    border: 1px solid #bbb;
    border-radius: 6px;
}
.access-group-options legend { padding: 0 6px; font-weight: bold; }
.access-group-options .terms-checkbox { margin: 0; }
