:root {
    --astreet-primary: #d4af37;
    --astreet-secondary: #e5c158;
    --astreet-accent: #b8931d;
    --astreet-gradient: linear-gradient(135deg, #e5c158, #b8931d);
}

body.astreet-theme-light, body.bg-white {
    --astreet-bg: #ffffff;
    --astreet-card: #f8fafc;
    --astreet-border: rgba(0, 0, 0, 0.08);
    --astreet-text: #334155;
    --astreet-heading: #0d0d0d;
    --astreet-text-muted: #64748b;
    --astreet-nav-bg: rgba(255, 255, 255, 0.85);
    --astreet-input-bg: #f8fafc;
    --astreet-input-border: #cbd5e1;
    --astreet-input-text: #0d0d0d;
    --astreet-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

body.astreet-theme-dark {
    --astreet-bg: #0f172a;
    --astreet-card: #1e293b;
    --astreet-border: rgba(255, 255, 255, 0.08);
    --astreet-text: #e2e8f0;
    --astreet-heading: #f8fafc;
    --astreet-text-muted: #94a3b8;
    --astreet-nav-bg: rgba(30, 41, 59, 0.85);
    --astreet-input-bg: rgba(15, 23, 42, 0.5);
    --astreet-input-border: rgba(255, 255, 255, 0.08);
    --astreet-input-text: #ffffff;
    --astreet-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body {
    background-color: var(--astreet-bg);
    color: var(--astreet-text);
    font-family: var(--tlc-root-font-family, 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding-top: 72px; /* For locked header */
    padding-bottom: 60px; /* For locked footer */
}

/* ... existing classes ... */

/* Utility Classes */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
}

.margin-b-0 {
    margin-bottom: 0 !important;
}

.text-small {
    font-size: 0.85rem;
}

.text-primary {
    color: var(--astreet-primary);
}

.w-full {
    width: 100%;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mr-10 {
    margin-right: 10px;
}

.heading-large {
    font-size: 1.8rem;
    font-weight: 700;
}

.no-decoration {
    text-decoration: none;
}

.btn-full {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
    font-size: 1.1rem;
}

.glass-nav {
    background: var(--astreet-nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--astreet-border);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* Lock to top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 72px;
    box-sizing: border-box;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--astreet-gradient); /* Complete gold */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-links a {
    color: var(--astreet-text-muted);
    text-decoration: none;
    margin-left: 2rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--astreet-primary);
}

.btn-primary {
    background: var(--astreet-gradient); /* Complete gold */
    color: white !important;
    padding: 0.6rem 1.6rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(212, 175, 55, 0.5);
}

/* Layout & Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-section {
    padding: 6rem 2rem;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -1.5px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--astreet-text-muted);
    max-width: 650px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.hero-gradient-text {
    background: linear-gradient(135deg, var(--astreet-primary), var(--astreet-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-group {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    align-items: center;
}

.btn-outline {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--astreet-border);
    padding: 0.6rem 1.6rem;
    border-radius: 9999px;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.features-grid {
    margin-top: 6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--astreet-card);
    padding: 2.5rem;
    border-radius: 24px;
    text-align: left;
    border: 1px solid var(--astreet-border);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1.2rem;
}

/* Forms */
.form-container {
    max-width: 440px;
    margin: 4rem auto;
    padding: 3rem;
    background: var(--astreet-card);
    border-radius: 28px;
    border: 1px solid var(--astreet-border);
    box-shadow: var(--astreet-shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--astreet-text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--astreet-text);
}

.form-input {
    width: 100%;
    background: var(--astreet-input-bg);
    border: 1px solid var(--astreet-input-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--astreet-input-text);
    outline: none;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--astreet-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-input-combined {
    display: flex;
    align-items: center;
    background: var(--astreet-input-bg);
    border: 1px solid var(--astreet-input-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    transition: all 0.2s;
}

.form-input-combined input {
    background: transparent;
    border: none;
    color: var(--astreet-input-text);
    outline: none;
    width: 100%;
    font-size: 1rem;
}

.form-input-combined:focus-within {
    border-color: var(--astreet-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-handle-suffix {
    color: var(--astreet-primary);
    font-weight: 700;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--astreet-text-muted);
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--astreet-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Mailbox Layout */
.mailbox-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 72px);
    overflow: hidden;
}

.mailbox-sidebar {
    background: rgba(15, 23, 42, 0.5);
    border-right: 1px solid var(--astreet-border);
    padding: 2rem 1.5rem;
}

.mailbox-content {
    background: var(--astreet-bg);
    overflow-y: auto;
    padding: 2rem;
}

.mailbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mailbox-search {
    background: var(--astreet-card);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--astreet-border);
}

.mailbox-search input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 200px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    color: #94a3b8;
    font-weight: 500;
}

.nav-item.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--astreet-primary);
    font-weight: 600;
}

.nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
}

.mail-card {
    background: var(--astreet-card);
    border: 1px solid var(--astreet-border);
    padding: 1.2rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mail-card:hover {
    border-color: var(--astreet-primary);
    transform: translateX(4px);
    background: rgba(30, 41, 59, 0.9);
}

.mail-card.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--astreet-primary);
}

.mail-item-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.mail-item-sender {
    font-weight: 700;
    color: #f8fafc;
}

.mail-item-time {
    font-size: 0.85rem;
    color: #64748b;
}

.mail-item-subject {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.mail-item-preview {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.page-footer {
    position: fixed; /* Lock to bottom */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 12px 24px;
    z-index: 1000;
    box-sizing: border-box;
    height: 60px;
    display: flex;
    align-items: center;
}

.footer-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.footer-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.page-footer a, .page-footer span {
    color: #000000 !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.page-footer a:hover {
    color: var(--astreet-primary) !important;
}

/* Alerts */
.alert-wrapper {
    margin-top: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--astreet-border);
}

.alert-error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

.alert-success {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.2);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--astreet-heading);
}

/* Password Strength Meter styles */
.strength-meter {
    margin-top: 0.5rem;
}
.strength-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.strength-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
}

/* Setup Wizard styles */
.setup-container {
    max-width: 650px;
    margin: 4rem auto;
    padding: 3rem;
    background: var(--astreet-card);
    border-radius: 28px;
    border: 1px solid var(--astreet-border);
    box-shadow: var(--astreet-shadow);
}

.setup-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.setup-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--astreet-primary), var(--astreet-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.setup-header p {
    color: var(--astreet-text-muted);
    font-size: 1.1rem;
}

.setup-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--astreet-border);
}
.setup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setup-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--astreet-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-email-card {
    background: var(--astreet-input-bg);
    border: 1px solid var(--astreet-input-border);
    padding: 1.2rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.primary-email-address {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--astreet-primary);
}

.aliases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.alias-item {
    background: var(--astreet-input-bg);
    border: 1px solid var(--astreet-input-border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--astreet-text);
    font-size: 0.95rem;
}

.copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover {
    color: var(--astreet-primary);
    background: rgba(212, 175, 55, 0.08);
}

.tabs-container {
    margin-top: 1.5rem;
}
.tabs-header {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}
.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab-btn.active {
    color: var(--astreet-primary);
    border-bottom-color: var(--astreet-primary);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.instruction-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    color: var(--astreet-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.step-text {
    color: var(--astreet-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.step-text strong {
    color: var(--astreet-text);
}

.server-settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--astreet-input-bg);
    border: 1px solid var(--astreet-input-border);
    border-radius: 12px;
    overflow: hidden;
}
.server-settings-table th,
.server-settings-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
}
.server-settings-table th {
    background: rgba(128, 128, 128, 0.08);
    font-weight: 600;
    color: var(--astreet-text);
    border-bottom: 1px solid var(--astreet-border);
}
.server-settings-table td {
    border-bottom: 1px solid var(--astreet-border);
    color: var(--astreet-text-muted);
}
.server-settings-table tr:last-child td {
    border-bottom: none;
}
.setting-value-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-weight: 600;
}

/* Async check handle indicator */
.handle-indicator {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
}
.handle-indicator.success {
    color: #10b981;
}
.handle-indicator.error {
    color: #ef4444;
}
.handle-indicator.checking {
    color: #f59e0b;
}
