/* ResolveDesk Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --rd-green: #48bb78;
    --rd-green-dark: #38a169;
    --rd-dark: #1a1d23;
    --rd-gray-50: #f8f9fa;
    --rd-gray-100: #f1f3f5;
    --rd-gray-200: #e5e7eb;
    --rd-gray-400: #9ca3af;
    --rd-gray-600: #6b7280;
    --rd-gray-800: #374151;
    --rd-red: #e53e3e;
    --rd-orange: #ed8936;
    --rd-blue: #4299e1;
    --rd-radius: 6px;
}

body {
    margin: 0;
    min-width: 1024px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--rd-gray-800);
    background: var(--rd-gray-50);
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    font-weight: 600;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

a { color: var(--rd-green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cards */
.rd-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.rd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Buttons */
.rd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--rd-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.rd-btn-primary {
    background: var(--rd-green);
    color: #fff;
}
.rd-btn-primary:hover { background: var(--rd-green-dark); }

.rd-btn-secondary {
    background: #fff;
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
}
.rd-btn-secondary:hover { background: var(--rd-gray-100); }

.rd-btn-danger {
    background: var(--rd-red);
    color: #fff;
}
.rd-btn-danger:hover { background: #c53030; }

.rd-btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Forms */
.rd-form-group {
    margin-bottom: 1rem;
}

.rd-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--rd-gray-600);
}

.rd-input, .rd-select, .rd-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    font-size: 0.9rem;
    transition: border-color 0.15s;
}

.rd-input:focus, .rd-select:focus, .rd-textarea:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

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

/* Tables */
.rd-table {
    width: 100%;
    border-collapse: collapse;
}

.rd-table th, .rd-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-gray-600);
    background: var(--rd-gray-50);
}

.rd-table tr:hover { background: var(--rd-gray-50); }

/* Badges */
.rd-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rd-badge-new { background: #ebf8ff; color: #2b6cb0; }
.rd-badge-triaged { background: #fefcbf; color: #975a16; }
.rd-badge-inprogress { background: #c6f6d5; color: #276749; }
.rd-badge-awaiting { background: #fed7d7; color: #9b2c2c; }
.rd-badge-escalated { background: #fed7e2; color: #97266d; }
.rd-badge-resolved { background: #c6f6d5; color: #22543d; }
.rd-badge-closed { background: var(--rd-gray-100); color: var(--rd-gray-600); }

/* ─── Status History ─── */

.rd-status-created {
    background: rgba(72, 187, 120, 0.04);
}

.rd-status-created td {
    border-bottom-color: rgba(72, 187, 120, 0.12);
}

.rd-status-created-icon {
    color: var(--rd-green);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.rd-status-transition-icon {
    color: var(--rd-gray-400);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.rd-badge-ai-log {
    background: #dbeafe;
    color: #1e40af;
}

.rd-badge-low { background: #ebf8ff; color: #2b6cb0; }
.rd-badge-medium { background: #fefcbf; color: #975a16; }
.rd-badge-high { background: #fed7d7; color: #9b2c2c; }
.rd-badge-critical { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

/* Stats Grid */
.rd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rd-stat-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 1rem 1.25rem;
}

.rd-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rd-gray-800);
}

.rd-stat-label {
    font-size: 0.8rem;
    color: var(--rd-gray-600);
    margin-top: 0.15rem;
}

/* Utilities */
.rd-flex { display: flex; }
.rd-flex-between { display: flex; justify-content: space-between; align-items: center; }
.rd-gap-1 { gap: 0.5rem; }
.rd-gap-2 { gap: 1rem; }
.rd-mt-1 { margin-top: 0.5rem; }
.rd-mt-2 { margin-top: 1rem; }
.rd-mb-1 { margin-bottom: 0.5rem; }
.rd-mb-2 { margin-bottom: 1rem; }
.rd-text-muted { color: var(--rd-gray-600); }
.rd-text-sm { font-size: 0.8rem; }

/* ─── Ticket Header Breadcrumb ─── */

.rd-ticket-header-back {
    margin-bottom: 0.25rem;
}

.rd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--rd-green-dark);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.rd-back-link:hover {
    color: var(--rd-green);
    text-decoration: underline;
}

.rd-ticket-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
}

.rd-breadcrumb-link {
    color: var(--rd-gray-500);
    text-decoration: none;
    font-weight: 500;
}

.rd-breadcrumb-link:hover {
    color: var(--rd-green-dark);
    text-decoration: underline;
}

.rd-breadcrumb-sep {
    color: var(--rd-gray-400);
    font-weight: 600;
}

.rd-breadcrumb-current {
    color: var(--rd-gray-800);
    font-weight: 600;
}

/* ─── Details Card ─── */

.rd-details-card {
    padding: 1rem 1.1rem;
}

.rd-details-heading {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0A0F1D;
}

.rd-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 0.5rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    overflow: hidden;
}

.rd-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--rd-gray-200);
    border-right: 1px solid var(--rd-gray-200);
    font-size: 0.8rem;
}

.rd-detail-field:nth-child(even) {
    border-right: none;
}

.rd-detail-field:nth-last-child(-n+2) {
    border-bottom: none;
}

.rd-detail-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748B;
}

.rd-detail-value {
    font-size: 0.78rem;
    font-weight: 500;
    color: #0A0F1D;
}

/* ─── Refined Pills ─── */

.rd-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

.rd-pill--new {
    background: #EFF6FF;
    color: #1D4ED8;
}

.rd-pill--critical {
    background: #FEF2F2;
    color: #DC2626;
}

.rd-pill--unassigned {
    background: #F1F5F9;
    color: #64748B;
    font-weight: 500;
}

/* ─── SLA Block ─── */

.rd-sla-block {
    background: #F8FAFC;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 0.7rem 0.85rem;
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rd-sla-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.rd-sla-icon {
    flex-shrink: 0;
    color: #64748B;
}

.rd-sla-row-label {
    font-weight: 600;
    color: #0A0F1D;
    min-width: 6.5rem;
}

.rd-sla-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.rd-sla-badge--breached {
    background: #FEF2F2;
    color: #DC2626;
}

.rd-sla-badge--met {
    background: #F0FDF4;
    color: #16A34A;
}

.rd-sla-badge--due {
    background: #FFF7ED;
    color: #EA580C;
}

.rd-sla-badge--overdue {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    animation: rd-sla-overdue-pulse 2s ease-in-out infinite;
}

@keyframes rd-sla-overdue-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
}

/* ─── AI Panel ─── */
.rd-ai-panel {
    background: linear-gradient(135deg, #f0fff4, #ebf8ff);
    border: 1px solid #c6f6d5;
    border-radius: var(--rd-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.rd-ai-panel--loading {
    border-color: #9ae6b4;
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.15);
}

.rd-ai-panel h4 {
    font-size: 0.85rem;
    color: var(--rd-green-dark);
    margin: 0 0 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rd-badge-latest {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--rd-green);
    color: #fff;
    line-height: 1.4;
}

.rd-ai-panel p, .rd-ai-panel pre {
    margin: 0;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

/* ─── Magical AI Loader ─── */

.rd-ai-btn {
    position: relative;
}

.rd-ai-loader {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rd-ai-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--rd-green);
    display: inline-block;
    animation: rd-ai-bounce 1.2s ease-in-out infinite;
}

.rd-ai-dot--1 { animation-delay: 0s; }
.rd-ai-dot--2 { animation-delay: 0.2s; }
.rd-ai-dot--3 { animation-delay: 0.4s; }

@keyframes rd-ai-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.rd-ai-thinking {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 0.5rem;
}

.rd-ai-pulse {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-green), #4299e1);
    flex-shrink: 0;
    animation: rd-ai-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(72, 187, 120, 0.35);
}

@keyframes rd-ai-pulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.5);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 20px 4px rgba(72, 187, 120, 0.2);
    }
    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

.rd-ai-thinking-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 2px;
}

.rd-ai-thinking-line {
    font-size: 0.8rem;
    color: var(--rd-gray-600);
    animation: rd-ai-fade-slide 0.6s ease-out forwards;
    opacity: 0;
}

.rd-ai-thinking-line:nth-child(1) { animation-delay: 0s; }
.rd-ai-thinking-line:nth-child(2) { animation-delay: 1.2s; }
.rd-ai-thinking-line:nth-child(3) { animation-delay: 2.4s; }

@keyframes rd-ai-fade-slide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SLA indicator (legacy) */
.rd-sla-ok { color: var(--rd-green-dark); }
.rd-sla-warning { color: var(--rd-orange); }
.rd-sla-breached { color: var(--rd-red); font-weight: 600; }

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    font-size: 0.8rem;
}

/* ─── @mention Autocomplete Dropdown ─── */

.rd-mention-dropdown {
    position: absolute;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 180px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem;
    display: none;
}

.rd-mention-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.1s ease;
}

.rd-mention-item:hover,
.rd-mention-item--active {
    background: rgba(72, 187, 120, 0.1);
}

.rd-mention-item-avatar {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--rd-green-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rd-mention-item-name {
    font-weight: 600;
    color: var(--rd-gray-800);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-mention-item-name strong {
    color: var(--rd-green-dark);
}

.rd-mention-item-email {
    font-size: 0.72rem;
    color: var(--rd-gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--rd-radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.rd-institution-logo {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--rd-gray-200);
}

.rd-institution-logo-large {
    width: 3rem;
    height: 3rem;
}

.rd-context-menu {
    position: relative;
}

.rd-context-menu summary {
    list-style: none;
}

.rd-context-menu summary::-webkit-details-marker {
    display: none;
}

.rd-context-menu-list {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 10.5rem;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 20;
}

.rd-context-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: var(--rd-radius);
    color: var(--rd-gray-800);
    font-size: 0.82rem;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.rd-context-menu-item:hover {
    background: var(--rd-gray-100);
}

.rd-context-menu-item-danger {
    color: var(--rd-red);
}

.rd-table-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.rd-table-row-clickable:hover {
    background: rgba(72, 187, 120, 0.06);
}

.rd-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.rd-detail-readonly-grid > div {
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    background: #fff;
    padding: 0.65rem 0.75rem;
}

.rd-detail-readonly-grid > div strong {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-gray-500);
    margin-bottom: 0.18rem;
}

@media (max-width: 860px) {
    .rd-detail-grid {
        grid-template-columns: 1fr;
    }
}

.rd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: rd-fade-in 180ms ease;
}

.rd-modal-panel {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    width: min(92vw, 34rem);
    max-height: 88vh;
    overflow: auto;
    padding: 1rem 1.1rem;
    animation: rd-modal-in 220ms ease;
}

.rd-modal-panel-lg {
    width: min(92vw, 42rem);
}

.rd-wizard-modal {
    width: min(96vw, 68rem);
}

.rd-wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.rd-wizard-span-2 {
    grid-column: span 2;
}

.rd-wizard-progress {
    height: 6px;
    background: var(--rd-gray-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.rd-wizard-progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--rd-green), var(--rd-green-dark));
    transition: width 220ms ease;
}

.rd-wizard-step-animate {
    animation: rd-wizard-step-in 180ms ease;
}

.rd-wizard-input-invalid {
    border-color: var(--rd-red) !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
    animation: rd-field-pulse 220ms ease;
}

.rd-wizard-error {
    color: var(--rd-red);
    margin-top: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(229, 62, 62, 0.3);
    border-radius: var(--rd-radius);
    background: rgba(229, 62, 62, 0.06);
    animation: rd-field-pulse 220ms ease;
}

.rd-wizard-shake {
    animation: rd-wizard-shake 260ms ease;
}

.rd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.rd-tabs {
    display: flex;
    gap: 0.45rem;
    border-bottom: 1px solid var(--rd-gray-200);
    padding-bottom: 0.5rem;
}

.rd-tab {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    color: var(--rd-gray-600);
    border-radius: var(--rd-radius);
    padding: 0.4rem 0.7rem;
    font-size: 0.83rem;
    cursor: pointer;
}

.rd-tab.active {
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
    background: rgba(72, 187, 120, 0.08);
}

@keyframes rd-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rd-modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rd-wizard-step-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rd-field-pulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

@keyframes rd-wizard-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

@media (max-width: 860px) {
    .rd-wizard-grid {
        grid-template-columns: 1fr;
    }

    .rd-wizard-span-2 {
        grid-column: span 1;
    }
}

/* Billing Plans Grid */
.rd-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.rd-plan-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.rd-plan-card > *:not(.rd-plan-header) {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.rd-plan-card > *:last-child {
    padding-bottom: 1.25rem;
}

.rd-plan-header {
    padding: 0.85rem 1.25rem;
    text-align: center;
    background: var(--rd-gray-50);
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-plan-header-current {
    background: var(--rd-green);
    color: #fff;
    border-bottom-color: var(--rd-green-dark);
}

.rd-plan-header-current h3 {
    color: #fff;
}

.rd-plan-card-current {
    border-color: var(--rd-green);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.15);
}

.rd-plan-price {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.rd-plan-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rd-gray-800);
}

.rd-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.rd-plan-features li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--rd-gray-600);
}

.rd-plan-features li::before {
    content: "✓ ";
    color: var(--rd-green);
    font-weight: 600;
}

/* ─── Custom File Input ─── */

.rd-file-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.rd-file-btn-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    width: 100%;
    height: 100%;
}

.rd-badge-neutral {
    background: var(--rd-gray-100);
    color: var(--rd-gray-600);
}

/* ──────────── Landing Page ──────────── */

/* --- Shared --- */

.rd-landing-shell {
    min-height: 100vh;
    min-width: 1024px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.rd-landing-shell main {
    flex: 1;
}

.rd-landing-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Landing Buttons --- */

.rd-btn-landing {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.65rem 1.5rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    line-height: 1.4;
}

.rd-btn-landing--primary {
    background: var(--rd-green);
    color: #fff;
}

.rd-btn-landing--primary:hover {
    background: var(--rd-green-dark);
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.35);
}

.rd-btn-landing--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rd-btn-landing--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.rd-btn-landing--outline {
    background: transparent;
    color: var(--rd-gray-800);
    border: 1px solid var(--rd-gray-200);
}

.rd-btn-landing--outline:hover {
    background: var(--rd-gray-50);
    border-color: var(--rd-gray-400);
    text-decoration: none;
}

.rd-btn-landing--outline-green {
    background: transparent;
    color: var(--rd-green);
    border: 1px solid var(--rd-green);
}

.rd-btn-landing--outline-green:hover {
    background: rgba(72, 187, 120, 0.08);
    color: var(--rd-green-dark);
    border-color: var(--rd-green-dark);
    text-decoration: none;
}

.rd-btn-landing--sm {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
}

.rd-btn-landing--lg {
    padding: 0.85rem 2.25rem;
    font-size: 1rem;
}

/* --- Section Header --- */

.rd-section-header {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto 3.5rem;
}

.rd-section-header__label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rd-green);
    margin-bottom: 0.75rem;
}

.rd-section-header__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--rd-gray-800);
    margin: 0 0 0.75rem;
}

.rd-section-header__desc {
    font-size: 1rem;
    color: var(--rd-gray-600);
    margin: 0;
    line-height: 1.6;
}

/* --- Navigation --- */

.rd-landing-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rd-gray-200);
    padding: 0 1.5rem;
    height: 3.5rem;
}

.rd-landing-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.rd-landing-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--rd-gray-800);
}

.rd-landing-nav__brand strong {
    font-weight: 700;
}

.rd-landing-nav__brand:hover {
    text-decoration: none;
}

.rd-landing-nav__links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.rd-landing-nav__links > a:not(.rd-btn-landing) {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.rd-landing-nav__links > a:not(.rd-btn-landing):hover {
    color: var(--rd-green-dark);
    text-decoration: none;
}

/* --- Hero --- */

.rd-hero {
    position: relative;
    overflow: hidden;
    padding: 7rem 1.5rem 5.5rem;
    text-align: center;
    background-color: #1a1d23; /* Fallback background color */
}

.rd-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.rd-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
}

.rd-hero__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(72, 187, 120, 0.15) 0%, transparent 70%),
        linear-gradient(180deg, rgba(15, 17, 23, 0.15) 0%, rgba(26, 29, 35, 0.25) 50%, rgba(37, 42, 51, 0.35) 100%);
}

.rd-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 80%);
}

.rd-hero__content {
    position: relative;
    z-index: 1;
}

.rd-hero__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rd-green);
    border: 1px solid rgba(72, 187, 120, 0.3);
    border-radius: 100px;
    padding: 0.35rem 1rem;
    margin-bottom: 2rem;
    background: rgba(72, 187, 120, 0.06);
}

.rd-hero__title {
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
    color: #fff;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.rd-hero__title em {
    font-style: normal;
    color: var(--rd-green);
}

.rd-hero__subtitle {
    font-size: 1.1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.6);
    max-width: 38rem;
    margin: 0 auto 2.5rem;
}

.rd-hero__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.rd-hero__note {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 1.5rem;
}

/* --- Social Proof --- */

.rd-proof {
    background: var(--rd-gray-50);
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-proof__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.rd-proof__stat {
    text-align: center;
}

.rd-proof__stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    line-height: 1.2;
}

.rd-proof__stat span {
    font-size: 0.78rem;
    color: var(--rd-gray-600);
}

.rd-proof__divider {
    width: 1px;
    height: 2.5rem;
    background: var(--rd-gray-200);
    flex-shrink: 0;
}

/* --- Features --- */

.rd-features {
    padding: 5rem 1.5rem;
}

.rd-features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.rd-feature-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    transition: box-shadow 0.25s, transform 0.25s;
}

.rd-feature-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.rd-feature-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(72, 187, 120, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--rd-green-dark);
}

.rd-feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--rd-gray-800);
}

.rd-feature-card p {
    font-size: 0.88rem;
    color: var(--rd-gray-600);
    line-height: 1.6;
    margin: 0;
}

/* --- How It Works --- */

.rd-how {
    padding: 5rem 1.5rem;
    background: var(--rd-gray-50);
}

.rd-how__steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    max-width: 56rem;
    margin: 0 auto;
}

.rd-how__step {
    flex: 1;
    text-align: center;
    padding: 0 1.5rem;
}

.rd-how__number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rd-green);
    opacity: 0.6;
    margin-bottom: 1rem;
    line-height: 1;
}

.rd-how__step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rd-gray-800);
    margin: 0 0 0.5rem;
}

.rd-how__step p {
    font-size: 0.88rem;
    color: var(--rd-gray-600);
    line-height: 1.6;
    margin: 0;
}

.rd-how__connector {
    width: 48px;
    min-width: 48px;
    height: 2px;
    background: var(--rd-gray-200);
    margin-top: 1.25rem;
    flex-shrink: 0;
}

/* --- Pricing --- */

.rd-pricing {
    padding: 5rem 1.5rem;
}

.rd-pricing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 64rem;
    margin: 0 auto;
}

.rd-pricing-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: 12px;
    padding: 2.25rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s;
}

.rd-pricing-card--featured {
    border-color: var(--rd-green);
    box-shadow: 0 0 0 1px var(--rd-green), 0 8px 30px rgba(72, 187, 120, 0.10);
}

.rd-pricing-card__badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rd-green);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.85rem;
    border-radius: 100px;
    white-space: nowrap;
}

.rd-pricing-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rd-gray-800);
    margin: 0 0 1rem;
}

.rd-pricing-card__price {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.rd-pricing-card__amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    line-height: 1;
}

.rd-pricing-card__interval {
    font-size: 0.9rem;
    color: var(--rd-gray-400);
    font-weight: 500;
}

.rd-pricing-card__desc {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.rd-pricing-card__list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    flex: 1;
}

.rd-pricing-card__list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--rd-gray-800);
    padding: 0.35rem 0;
}

.rd-pricing-card__list li svg {
    flex-shrink: 0;
}

.rd-pricing-card .rd-btn-landing {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* --- Final CTA --- */

.rd-final-cta {
    text-align: center;
    padding: 5.5rem 1.5rem;
    background: var(--rd-dark);
    color: #fff;
}

.rd-final-cta__title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    max-width: 36rem;
    margin: 0 auto 1rem;
    line-height: 1.3;
}

.rd-final-cta__desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 30rem;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* --- Footer --- */

.rd-landing-footer {
    padding: 3rem 1.5rem 2rem;
    background: var(--rd-gray-50);
    border-top: 1px solid var(--rd-gray-200);
}

.rd-landing-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.rd-landing-footer__brand p {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    max-width: 22rem;
    margin: 0.75rem 0 0;
    line-height: 1.5;
}

.rd-landing-footer h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rd-gray-800);
    margin: 0 0 0.6rem;
}

.rd-landing-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rd-landing-footer ul li {
    margin-bottom: 0.35rem;
}

.rd-landing-footer ul a {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    text-decoration: none;
    transition: color 0.15s;
}

.rd-landing-footer ul a:hover {
    color: var(--rd-green-dark);
    text-decoration: none;
}

.rd-landing-footer__bottom {
    border-top: 1px solid var(--rd-gray-200);
    margin-top: 2rem;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--rd-gray-400);
}

/* --- Landing Responsive --- */

@media (max-width: 960px) {
    .rd-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rd-hero {
        padding: 5rem 1.5rem 3.5rem;
    }

    .rd-hero__subtitle {
        font-size: 1rem;
    }

    .rd-features__grid {
        grid-template-columns: 1fr;
    }

    .rd-how__steps {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .rd-how__connector {
        width: 2px;
        height: 32px;
        margin: 0;
    }

    .rd-proof__row {
        gap: 1.25rem;
    }

    .rd-proof__divider {
        display: none;
    }

    .rd-proof__row {
        flex-direction: column;
    }

    .rd-landing-footer__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .rd-landing-nav__links {
        gap: 0.75rem;
    }

    .rd-landing-nav__links > a:not(.rd-btn-landing) {
        display: none;
    }

    .rd-pricing__grid {
        grid-template-columns: 1fr;
        max-width: 24rem;
    }
}

/* ============================================================
   AUTH — Split-screen register / login
   ============================================================ */

.rd-auth-shell {
    display: grid;
    grid-template-columns: 5fr 7fr;
    height: 100vh;
    overflow: hidden;
}

/* --- Brand panel (left) --- */

.rd-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    height: 100vh;
    min-height: 600px;
}

.rd-auth-brand__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.rd-auth-brand__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 20%, rgba(72, 187, 120, 0.12) 0%, transparent 70%),
        linear-gradient(180deg, #0f1117 0%, #1a1d23 50%, #252a33 100%);
}

.rd-auth-brand__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 80%);
}

.rd-auth-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 22rem;
}

.rd-auth-brand__logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.rd-auth-brand__logo strong {
    font-weight: 700;
}

.rd-auth-brand__logo:hover {
    text-decoration: none;
    color: #fff;
}

.rd-auth-brand__copy h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.rd-auth-brand__copy p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin: 0;
}

.rd-auth-brand__proof {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rd-auth-proof-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Form panel (right) --- */

.rd-auth-form-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #fff;
    height: 100vh;
    overflow-y: auto;
}

.rd-auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.rd-auth-form-header {
    margin-bottom: 2rem;
}

.rd-auth-form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.rd-auth-form-header p {
    font-size: 0.9rem;
    color: var(--rd-gray-400);
    margin: 0;
}

/* Alerts */

.rd-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    border-radius: var(--rd-radius);
    margin-bottom: 1.5rem;
}

.rd-auth-alert svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.rd-auth-alert--error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.rd-auth-alert--success {
    color: #276749;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

/* Form */

.rd-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.rd-auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--rd-gray-600);
    margin-bottom: 0.3rem;
}

.rd-auth-field input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    font-size: 0.9rem;
    color: var(--rd-gray-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rd-auth-field input::placeholder {
    color: var(--rd-gray-400);
    font-weight: 400;
}

.rd-auth-field input:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

/* Field hint text */

.rd-auth-field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--rd-gray-400);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Inline domain warning */

.rd-auth-field-warn {
    display: block;
    font-size: 0.78rem;
    color: #c05621;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* ── Login password field with toggle ── */

.rd-pw-field {
    position: relative;
    display: flex;
    align-items: center;
}

.rd-pw-field input {
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
}

.rd-pw-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    color: var(--rd-gray-400);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.rd-pw-toggle:hover {
    color: var(--rd-gray-600);
    background: var(--rd-gray-100);
}

.rd-pw-toggle svg {
    display: block;
}

/* Addon fields (input + inline suffix) */

.rd-auth-field-addon {
    display: flex;
    align-items: stretch;
}

.rd-auth-field-addon input {
    border-radius: var(--rd-radius) 0 0 var(--rd-radius);
    border-right: none;
    flex: 1;
    min-width: 0;
}

.rd-auth-field-addon input:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
    z-index: 1;
    position: relative;
}

.rd-auth-field-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: var(--rd-gray-50);
    border: 1px solid var(--rd-gray-200);
    border-radius: 0 var(--rd-radius) var(--rd-radius) 0;
    font-size: 0.82rem;
    color: var(--rd-gray-500);
    white-space: nowrap;
    user-select: none;
}

/* Subdomain live-validation status */

.rd-subdomain-status {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.rd-subdomain-ok {
    color: var(--rd-green-dark, #276749);
}

.rd-subdomain-ok::before {
    content: '\2713';
    font-weight: 700;
}

.rd-subdomain-err {
    color: #c53030;
}

.rd-subdomain-err::before {
    content: '\2717';
    font-weight: 700;
}

.rd-subdomain-loading {
    color: var(--rd-gray-500);
}

.rd-subdomain-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--rd-gray-300);
    border-top-color: var(--rd-green);
    border-radius: 50%;
    animation: rd-spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes rd-spin {
    to { transform: rotate(360deg); }
}

/* Submit */

.rd-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--rd-green);
    border: none;
    border-radius: var(--rd-radius);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    margin-top: 0.35rem;
}

.rd-auth-submit:hover {
    background: var(--rd-green-dark);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.25);
}

.rd-auth-submit:active {
    transform: scale(0.985);
}

/* Alt link */

.rd-auth-alt {
    text-align: center;
    font-size: 0.85rem;
    color: var(--rd-gray-400);
    margin-top: 1.75rem;
}

.rd-auth-alt a {
    color: var(--rd-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.rd-auth-alt a:hover {
    text-decoration: underline;
}

/* Status icons (verify-email / denied) */

.rd-auth-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}

.rd-auth-status-icon--success {
    color: #276749;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

.rd-auth-status-icon--error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.rd-auth-status-icon--warn {
    color: #975a16;
    background: #fffff0;
    border: 1px solid #fefcbf;
}

.rd-auth-status-icon--info {
    color: #2b6cb0;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
}

/* --- Auth Responsive --- */

@media (max-width: 768px) {
    .rd-auth-shell {
        grid-template-columns: 1fr;
    }

    .rd-auth-brand {
        padding: 2.5rem 1.5rem 2rem;
    }

    .rd-auth-brand__content {
        max-width: 100%;
        gap: 1.5rem;
    }

    .rd-auth-brand__copy h1 {
        font-size: 1.35rem;
    }

    .rd-auth-form-panel {
        padding: 2rem 1.5rem 3rem;
    }
}

@media (max-width: 480px) {
    .rd-auth-brand__proof {
        display: none;
    }

    .rd-auth-brand {
        padding: 2rem 1.25rem 1.5rem;
    }

    .rd-auth-form-panel {
        padding: 1.5rem 1.25rem 2.5rem;
    }
}

/* ══════════════════════════════════════════
   Markdown Content Rendering  (rd-md-content)
   ══════════════════════════════════════════ */

.rd-md-content {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--rd-gray-800);
    word-break: break-word;
}

/* Paragraphs */
.rd-md-content p {
    margin: 0 0 0.7em;
}
.rd-md-content p:last-child { margin-bottom: 0; }

/* Headings */
.rd-md-content h1,
.rd-md-content h2,
.rd-md-content h3,
.rd-md-content h4 {
    margin: 0.9em 0 0.35em;
    font-weight: 600;
    line-height: 1.3;
    color: #0A0F1D;
}
.rd-md-content h1 { font-size: 1.15rem; }
.rd-md-content h2 { font-size: 1.05rem; }
.rd-md-content h3 { font-size: 0.95rem; }
.rd-md-content h4 { font-size: 0.88rem; }

/* Bold / Italic */
.rd-md-content strong { font-weight: 700; }
.rd-md-content em     { font-style: italic; }

/* Lists */
.rd-md-content ul,
.rd-md-content ol {
    margin: 0.4em 0 0.7em 1.4em;
    padding: 0;
}
.rd-md-content li { margin: 0.2em 0; }

/* Task-list checkboxes */
.rd-md-content input[type="checkbox"] {
    margin-right: 0.4em;
    vertical-align: middle;
}

/* Blockquote */
.rd-md-content blockquote {
    margin: 0.5em 0 0.7em;
    padding: 0.4em 0.9em;
    border-left: 3px solid var(--rd-green);
    background: rgba(72, 187, 120, 0.06);
    border-radius: 0 var(--rd-radius) var(--rd-radius) 0;
    color: var(--rd-gray-600);
    font-size: 0.88rem;
}
.rd-md-content blockquote p { margin: 0; }

/* Inline code */
.rd-md-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82em;
    background: #F1F5F9;
    color: #0369A1;
    padding: 0.1em 0.38em;
    border-radius: 3px;
    border: 1px solid #E2E8F0;
}

/* Code block */
.rd-md-content pre {
    background: #0F172A;
    color: #CBD5E1;
    border-radius: var(--rd-radius);
    padding: 0.85em 1em;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0.5em 0 0.8em;
}
.rd-md-content pre code {
    background: none;
    color: inherit;
    font-size: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Tables */
.rd-md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0 0.8em;
    font-size: 0.85rem;
}
.rd-md-content th,
.rd-md-content td {
    padding: 0.4em 0.65em;
    border: 1px solid var(--rd-gray-200);
    text-align: left;
}
.rd-md-content th {
    background: var(--rd-gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--rd-gray-600);
}
.rd-md-content tr:hover td { background: var(--rd-gray-50); }

/* Horizontal rule */
.rd-md-content hr {
    border: none;
    border-top: 1px solid var(--rd-gray-200);
    margin: 0.8em 0;
}

/* Links */
.rd-md-content a {
    color: var(--rd-green-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rd-md-content a:hover { color: var(--rd-green); }


/* ══════════════════════════════════════════
   Markdown Editor (composer)
   ══════════════════════════════════════════ */

.rd-md-editor {
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rd-md-editor:focus-within {
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

/* Tab bar */
.rd-md-editor-tabs {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem 0;
    background: var(--rd-gray-50);
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-md-tab {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--rd-radius) var(--rd-radius) 0 0;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
    position: relative;
    bottom: -1px;
}
.rd-md-tab:hover { color: var(--rd-gray-800); background: var(--rd-gray-100); }

.rd-md-tab--active {
    background: #fff;
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
    font-weight: 600;
}

.rd-md-tab-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--rd-gray-400);
    padding-right: 0.25rem;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rd-md-tab-hint::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.7;
}

/* Toolbar */
.rd-md-toolbar {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.5rem;
    background: #fff;
    border-bottom: 1px solid var(--rd-gray-200);
    flex-wrap: wrap;
}

.rd-md-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    flex-shrink: 0;
}
.rd-md-tool:hover {
    background: var(--rd-gray-100);
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
}
.rd-md-tool:active {
    background: rgba(72, 187, 120, 0.12);
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
}

.rd-md-tool-sep {
    width: 1px;
    height: 18px;
    background: var(--rd-gray-200);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

/* Textarea inside editor (removes default styling since border is on wrapper) */
.rd-md-textarea {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 110px;
    resize: vertical;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
}
.rd-md-textarea:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Preview pane */
.rd-md-preview {
    min-height: 110px;
    padding: 0.65rem 0.85rem;
    background: #fff;
}

.rd-md-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rd-gray-400);
}

/* ═══════════════════════════════════════════════════════
   Ticket Detail — Header Action Bar
   ═══════════════════════════════════════════════════════ */

.rd-ticket-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rd-ticket-header-title {
    flex: 1 1 auto;
    min-width: 0;
}

.rd-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.rd-header-btn {
    /* slightly tighter than default for header density */
    padding: 0.42rem 0.85rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Outlined danger variant — Escalate button */
.rd-btn-outline-danger {
    background: #fff;
    border-color: var(--rd-red);
    color: var(--rd-red);
}
.rd-btn-outline-danger:hover {
    background: #fff5f5;
}

/* Solid green resolve variant */
.rd-btn-resolve {
    background: var(--rd-green);
    color: #fff;
    border-color: transparent;
}
.rd-btn-resolve:hover {
    background: var(--rd-green-dark);
}
.rd-btn-resolve:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   Modal — shared enhancements
   ═══════════════════════════════════════════════════════ */

/* Upgrade existing .rd-modal-panel with a slightly larger padding */
.rd-modal-panel {
    padding: 1.25rem 1.35rem;
}

.rd-modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Coloured icon badge beside the modal title */
.rd-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rd-modal-icon--success {
    background: rgba(72, 187, 120, 0.12);
    color: var(--rd-green-dark);
}

.rd-modal-icon--danger {
    background: rgba(229, 62, 62, 0.1);
    color: var(--rd-red);
}

.rd-modal-icon--neutral {
    background: var(--rd-gray-100);
    color: var(--rd-gray-600);
}

/* Close (×) button */
.rd-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.rd-modal-close:hover {
    background: var(--rd-gray-100);
    color: var(--rd-gray-800);
}

/* Footer row */
.rd-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rd-gray-200);
}

/* Inline error banner */
.rd-modal-error {
    background: rgba(229, 62, 62, 0.07);
    border: 1px solid rgba(229, 62, 62, 0.25);
    border-radius: var(--rd-radius);
    color: var(--rd-red);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

/* Character count helper text */
.rd-char-count {
    font-size: 0.75rem;
    color: var(--rd-gray-600);
    margin-top: 0.3rem;
    text-align: right;
}
.rd-char-count--warn {
    color: var(--rd-orange);
}

/* ═══════════════════════════════════════════════════════
   Log Time — quick-pick chips
   ═══════════════════════════════════════════════════════ */

.rd-time-quickpick {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rd-time-chip {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: 999px;
    background: #fff;
    color: var(--rd-gray-800);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.14s;
}
.rd-time-chip:hover {
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
    background: rgba(72, 187, 120, 0.05);
}
.rd-time-chip--active {
    border-color: var(--rd-green);
    background: rgba(72, 187, 120, 0.1);
    color: var(--rd-green-dark);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   Inline spinner (used inside submit buttons)
   ═══════════════════════════════════════════════════════ */

.rd-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rd-spin 0.65s linear infinite;
}

@keyframes rd-spin {
    to { transform: rotate(360deg); }
}