/* Brasserio Portal - Material 3 Design System */

:root {
    --br-primary: #1B3C57;
    --br-primary-light: #2B5277;
    --br-primary-dark: #0B2C47;
    --br-on-primary: #ffffff;

    --br-secondary: #6AA3D2;
    --br-on-secondary: #ffffff;

    --br-success: #2E7D32;
    --br-success-light: #EDF7ED;
    --br-error: #D32F2F;
    --br-error-light: #FDEDED;

    --br-surface: #ffffff;
    --br-surface-variant: #F4F6FA;
    --br-on-surface: #1C1B1F;
    --br-on-surface-variant: #6B7280;
    --br-background: #f5f5f5;
    --br-outline: #E5E7EB;
    --br-outline-variant: #D1D5DB;
    --br-info: #0288d1;
    --br-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --br-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);

    --br-radius: 12px;
    --br-radius-sm: 8px;
    --br-radius-lg: 16px;

    --br-text: #212121;
    --br-text-secondary: #757575;
    --br-border: #e0e0e0;
    --br-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Layout */
.br-card {
    background: var(--br-surface);
    border-radius: var(--br-radius);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    margin: 16px 0;
}

.br-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.br-vertical-margin {
    margin-top: 100px;
    margin-bottom: 100px;
}

/* Typography */
.br-h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: var(--br-on-surface);
}

.br-h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--br-text);
}

.br-muted {
    color: var(--br-text-secondary);
}

/* Forms */
.br-form {
    max-width: 80%;
    margin: 0 auto;
}

.br-field {
    display: block;
    margin: 0 0 20px 0;
}

.br-field span {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--br-text);
}

.br-field input,
.br-field select,
.br-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.br-field input:focus,
.br-field select:focus,
.br-field textarea:focus {
    outline: none;
    border-color: var(--br-primary);
}

.br-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Password field with toggle */
.br-password-field {
    position: relative;
}

.br-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.br-password-wrapper input {
    flex: 1;
    padding-right: 80px;
}

.br-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--br-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
}

.br-toggle-password:hover {
    text-decoration: underline;
}

/* Buttons */
.br-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--br-radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--br-surface);
    color: var(--br-text);
    border: 1px solid var(--br-border);
}

.br-btn:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.br-btn-primary {
    background: var(--br-primary);
    color: white;
    border: none;
}

.br-btn-primary:hover {
    background: var(--br-primary-dark);
}

.br-btn-danger {
    background: transparent;
    color: var(--br-error);
    border: 1px solid var(--br-error);
}

.br-btn-danger:hover {
    background: var(--br-error-light);
}

.br-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.br-error,
.br-success,
.br-info {
    padding: 16px;
    border-radius: var(--br-radius-sm);
    margin: 16px 0;
    font-weight: 500;
}

.br-error {
    background: #ffebee;
    color: var(--br-error);
    border: 1px solid #ef9a9a;
}

.br-success {
    background: #e8f5e9;
    color: var(--br-success);
    border: 1px solid #a5d6a7;
}

.br-info {
    background: #e3f2fd;
    color: var(--br-info);
    border: 1px solid #90caf9;
}

/* Links */
.br-links {
    text-align: center;
    margin: 20px 0;
}

.br-links a {
    color: var(--br-primary);
    text-decoration: none;
}

.br-links a:hover {
    text-decoration: underline;
}

/* Plans */
.br-plans {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.br-plan {
    padding: 24px;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.br-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.br-plan-selected {
    border: 2px solid var(--br-primary);
    box-shadow: 0 0 0 1px var(--br-primary);
}

.br-plan form {
    margin-top: 16px;
}

/* Status Chips */
.br-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.br-chip.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.br-chip.trial {
    background: #fff3e0;
    color: #e65100;
}

.br-chip.expired {
    background: #ffebee;
    color: #c62828;
}

/* Images */
.br-cover {
    width: 100%;
    height: auto;
    border-radius: var(--br-radius-sm);
    margin-bottom: 16px;
}

/* Lists */
.br-list {
    list-style: none;
    padding: 0;
}

.br-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--br-border);
}

.br-list li:last-child {
    border-bottom: none;
}

/* Choice/Radio Groups */
.br-choice {
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-sm);
    padding: 16px;
    margin: 0 0 20px 0;
}

.br-choice legend {
    font-weight: 600;
    padding: 0 8px;
}

.br-choice label {
    display: block;
    padding: 8px 0;
    cursor: pointer;
}

.br-choice input[type="radio"] {
    margin-right: 8px;
}

/* RTL Support */
[dir="rtl"] .br-field input,
[dir="rtl"] .br-field select,
[dir="rtl"] .br-field textarea {
    text-align: right;
}

[dir="rtl"] .br-choice input[type="radio"] {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .br-password-wrapper input {
    padding-right: 16px;
    padding-left: 80px;
}

[dir="rtl"] .br-toggle-password {
    right: auto;
    left: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .br-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .br-plans {
        grid-template-columns: 1fr;
    }

    .br-card {
        padding: 16px;
    }
}

/* Grid Layout */
.br-grid {
    display: grid;
    gap: 20px;
}

@media (min-width: 768px) {
    .br-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .br-grid .br-h2,
    .br-grid .br-choice,
    .br-grid .br-password-field,
    .br-grid button[type="submit"],
    .br-grid .br-error {
        grid-column: 1 / -1;
    }
}

/* Inline forms */
.br-inline {
    display: inline-block;
}

/* Additional CSS for Billing Page and Payment Results */

/* Billing Page - Pricing Options */
.br-pricing {
    display: flex;
    gap: 24px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--br-radius-sm);
}

.br-price-option {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: var(--br-radius-sm);
    border: 2px solid var(--br-border);
    position: relative;
}

.br-price-annual {
    border-color: var(--br-primary);
}

.br-save-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.br-price {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--br-text);
    margin: 12px 0 4px 0;
}

.br-price-period {
    display: block;
    font-size: 14px;
    color: var(--br-text-secondary);
    margin-bottom: 4px;
}

.br-price-monthly {
    display: block;
    font-size: 12px;
    color: var(--br-text-secondary);
    font-style: italic;
}

.br-price-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--br-text-secondary);
}

.br-btn-secondary {
    background: white;
    color: var(--br-primary);
    border: 2px solid var(--br-primary);
}

.br-btn-secondary:hover {
    background: var(--br-primary);
    color: white;
}

/* Plan Cards */
.br-plan-current {
    border: 2px solid #4CAF50;
    box-shadow: 0 0 0 1px #4CAF50;
}

.br-plan-canceled {
    border: 2px solid var(--br-error);
    box-shadow: 0 0 0 1px var(--br-error);
}

.br-plan-badge-canceled {
    background: var(--br-error) !important;
    color: white;
}


.br-plan-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.br-plan {
    position: relative;
}

/* Payment Result Pages */
.br-payment-result {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.br-payment-icon {
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
}

.br-payment-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--br-radius-sm);
    margin: 24px 0;
    text-align: left;
}

.br-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--br-border);
}

.br-detail-row:last-child {
    border-bottom: none;
}

.br-detail-label {
    font-weight: 500;
    color: var(--br-text-secondary);
}

.br-detail-value {
    font-weight: 600;
    color: var(--br-text);
}

.br-detail-value code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Responsive for Billing */
@media (max-width: 768px) {
    .br-pricing {
        flex-direction: column;
    }

    .br-price-divider {
        transform: rotate(90deg);
        margin: -10px 0;
    }

    .br-plans {
        grid-template-columns: 1fr;
    }
}

/* RTL Support for Billing */
[dir="rtl"] .br-save-badge {
    right: auto;
    left: -10px;
}

[dir="rtl"] .br-plan-badge {
    right: auto;
    left: 12px;
}

/* ============================
   Brasserio Dashboard Layout
   ============================ */

.br-dashboard-page {
    max-width: 80%;
    margin: 32px auto 48px auto;
    padding: 0 16px;
}

.br-dashboard-header {
    margin-bottom: 32px;
}

.br-section-eyebrow {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--br-on-surface-variant);
    margin-bottom: 4px;
}

.br-dashboard-title {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--br-on-surface);
}

.br-dashboard-subtitle {
    margin: 0;
    color: var(--br-on-surface-variant);
    font-size: 14px;
}

.br-card p,
.br-card li {
    max-width: 90%;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Summary bar */

.br-dashboard-summary {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.br-summary-card {
    background: var(--br-surface);
    border-radius: var(--br-radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--br-outline);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.br-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--br-on-surface-variant);
}

.br-summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--br-on-surface);
}

.br-summary-meta {
    font-size: 13px;
    color: var(--br-on-surface-variant);
}

.br-summary-chip-row {
    margin-bottom: 4px;
}

.br-chip-small {
    font-size: 10px;
    padding: 2px 8px;
}

/* Sections */

.br-section {
    margin-top: 24px;
    border-left: 4px solid var(--br-primary);
}

.br-section-account {
    border-left-color: var(--br-primary);
}

.br-section-restaurant {
    border-left-color: var(--br-secondary);
}

.br-section-license {
    border-left-color: #f57c00; /* accent for plans */
}

.br-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.br-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--br-on-surface);
}

.br-section-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--br-on-surface-variant);
}

.br-section-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--br-surface-variant);
    color: var(--br-on-surface-variant);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}


.br-section-pill-neutral {
    background: #e5f3ff;
    color: #0b5394;
}

/* Section body */

.br-section-body {
    gap: 24px;
}

.br-section-col {
    flex: 1 1 260px;
    min-width: 0;
}

.br-section-col-media {
    max-width: 320px;
}

.br-section-col-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.br-section-helper {
    font-size: 13px;
    color: var(--br-on-surface-variant);
    margin: 0 0 8px 0;
}

.br-section-notes {
    margin-top: 12px;
    font-size: 13px;
    color: var(--br-on-surface-variant);
}

.br-section-actions {
    margin-top: 16px;
}

/* Key-value list */

.br-kv {
    margin: 0;
}

.br-kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--br-outline-variant);
    font-size: 14px;
}

.br-kv-row:last-child {
    border-bottom: none;
}

.br-kv-row dt {
    font-weight: 500;
    color: var(--br-on-surface-variant);
}

.br-kv-row dd {
    margin: 0;
    font-weight: 500;
    color: var(--br-on-surface);
    text-align: right;
}

.br-kv-compact .br-kv-row {
    padding: 4px 0;
    font-size: 13px;
}

/* License blocks */

.br-license-block {
    margin-top: 16px;
    margin-bottom: 16px;
}

.br-license-block-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 6px 0;
    color: var(--br-on-surface-variant);
}

/* Bulleted feature list */

.br-list-bullets {
    list-style: disc;
    padding-left: 20px;
}

.br-list-bullets li {
    border-bottom: none;
    padding: 2px 0;
    font-size: 13px;
}

/* Secondary button for logout in account section */

.br-btn-secondary {
    background: var(--br-surface);
    color: var(--br-primary);
    border: 1px solid var(--br-primary);
}

.br-btn-secondary:hover {
    background: var(--br-primary-light);
    color: var(--br-on-primary);
}

/* Status chip colors (reuse existing .br-chip classes) */

.br-chip.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.br-chip.trial {
    background: #fff3e0;
    color: #e65100;
}

.br-chip.expired {
    background: #ffebee;
    color: #c62828;
}

/* Responsive tweaks */

@media (max-width: 768px) {
    .br-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .br-kv-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .br-kv-row dd {
        text-align: left;
    }

    .br-section-pill {
        max-width: 90%;
        padding: 6px 12px;
        border-radius: 999px;
        background: var(--br-surface-variant);
        color: var(--br-on-surface-variant);
        font-size: 12px;
        font-weight: 500;
    }

}

.br-signup-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--br-on-surface);
}

.br-signup-subtitle {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--br-on-surface-variant);
}

/* Filters */
.br-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.br-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.br-filter-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--br-on-surface-variant);
}

.br-filter-select {
    padding: 12px 16px;
    border: 1px solid var(--br-outline);
    border-radius: var(--br-radius);
    background: var(--br-surface);
    font-size: 14px;
    color: var(--br-on-surface);
    cursor: pointer;
    transition: var(--br-transition);
}

.br-filter-select:focus {
    outline: none;
    border-color: var(--br-primary);
    box-shadow: 0 0 0 3px rgba(27, 60, 87, 0.1);
}

.br-filter-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* Custom Select Dropdown */
.br-custom-select-wrapper {
    position: relative;
    user-select: none;
}

.br-custom-select {
    position: relative;
}

.br-custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--br-on-surface);
    background: var(--br-surface);
    border-radius: var(--br-radius);
    border: 2px solid var(--br-outline);
    cursor: pointer;
    transition: var(--br-transition);
}

.br-custom-select-trigger span {
    margin: 0 0 0 0;
}

.br-custom-select.open .br-custom-select-trigger {
    border-color: var(--br-primary);
    box-shadow: 0 0 0 3px rgba(27, 60, 87, 0.1);
}

.br-custom-select.disabled .br-custom-select-trigger {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--br-surface-variant);
}

.br-custom-select-trigger .br-arrow {
    position: relative;
    height: 10px;
    width: 10px;
}

.br-custom-select-trigger .br-arrow::before,
.br-custom-select-trigger .br-arrow::after {
    content: "";
    position: absolute;
    bottom: 0px;
    width: 0.15rem;
    height: 100%;
    transition: all 0.3s;
}

.br-custom-select-trigger .br-arrow::before {
    left: -3px;
    transform: rotate(-45deg);
    background-color: var(--br-on-surface-variant);
}

.br-custom-select-trigger .br-arrow::after {
    left: 3px;
    transform: rotate(45deg);
    background-color: var(--br-on-surface-variant);
}

.br-custom-select.open .br-arrow::before {
    transform: rotate(45deg);
}

.br-custom-select.open .br-arrow::after {
    transform: rotate(-45deg);
}

.br-custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--br-outline);
    border-radius: var(--br-radius);
    background: var(--br-surface);
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2;
    margin-top: 8px;
    max-height: calc(5 * 41px); /* 5 items visible */
    overflow-y: auto;
}

.br-custom-select.open .br-custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.br-custom-option {
    position: relative;
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--br-on-surface);
    cursor: pointer;
    transition: var(--br-transition);
    border-bottom: 1px solid var(--br-outline);
}

.br-custom-option:last-child {
    border-bottom: none;
}

.br-custom-option:hover {
    background-color: var(--br-surface-variant);
}

.br-custom-option.selected {
    color: var(--br-on-primary);
    background-color: var(--br-primary);
}

/* Cover image & placeholder */
.br-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e7e7ee;
  background: #f7f7fb;
  display: block;
  margin-bottom: var(--br-space-4);
}
.br-placeholder {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 12px;
  border: 1px dashed #cfd5df;
  background: repeating-linear-gradient(
    45deg,
    #fafbff,
    #fafbff 10px,
    #f1f3f8 10px,
    #f1f3f8 20px
  );
}

/* Image upload area */
.br-image-upload {
  display: grid;
  gap: var(--br-space-3);
}
.br-image-upload input[type="file"] {
  padding: var(--br-space-3);
  background: var(--br-color-surface-2);
  border-radius: 12px;
  border: 1px dashed #cfd5df;
  cursor: pointer;
}
.br-image-upload input[type="file"]:hover {
  background: #f3f6fb;
}
.br-image-upload progress {
  width: 100%;
  height: 10px;
  border: none;
  appearance: none;
}
.br-image-upload progress::-webkit-progress-bar {
  background: #eef2f7;
  border-radius: 9999px;
}
.br-image-upload progress::-webkit-progress-value {
  background: var(--br-color-primary);
  border-radius: 9999px;
}
.br-image-upload progress::-moz-progress-bar {
  background: var(--br-color-primary);
  border-radius: 9999px;
}

.br-min-height-500 {
    min-height: 500px;
}

/* RTL support */

[dir="rtl"] .br-kv-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .br-kv-row dd {
    text-align: left;
}

[dir="rtl"] .br-dashboard-page {
    text-align: right;
}


 /* Header Image Uploader */
 .br-header-uploader {
     position: relative;
     width: 80px;
     height: 80px;
     flex-shrink: 0;
     border-radius: 12px;
     overflow: hidden;
     cursor: pointer;
     border: 1px solid rgba(0,0,0,0.1);
     background: #f5f5f5;
 }
 .br-header-uploader img {
     width: 100%;
     height: 100%;
     object-fit: cover;
     display: block;
 }
 .br-header-uploader-placeholder {
     width: 100%;
     height: 100%;
     display: flex;
     align-items: center;
     justify-content: center;
     color: #aaa;
     font-size: 10px;
 }
 .br-header-uploader-overlay {
     position: absolute;
     inset: 0;
     background: rgba(0,0,0,0.6);
     color: white;
     display: flex;
     align-items: center;
     justify-content: center;
     text-align: center;
     font-size: 10px;
     padding: 4px;
     opacity: 0;
     transition: opacity 0.2s;
     pointer-events: none;
     line-height: 1.2;
     white-space: pre-line;
 }
 .br-header-uploader:hover .br-header-uploader-overlay {
     opacity: 1;
 }