@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font-family: 'Inconsolata', monospace, sans-serif !important;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

html,
body {
    background-color: #000000;
    color: #ffffff;
    min-height: 100vh;
    min-width: 100%;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #090909;
}
::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #808080;
}

/* Typography */
h1 {
    font-weight: 400;
    font-size: 1.55em;
    letter-spacing: -0.02em;
}
h1 a {
    text-decoration: none;
    color: #ffffff;
}
h1 a:hover {
    text-decoration: underline;
}
h1 i {
    font-style: normal;
    color: #808080;
}
p {
    font-size: 16px;
    color: #808080;
    font-weight: 500;
    line-height: 1.5;
}
a {
    color: #ffffff;
    text-decoration: underline;
}

/* Notice & Warning Banners (Identical to kody.cc) */
.step-warning {
    display: none;
    width: 100%;
    margin: 12px 0;
    color: #ff4d4d;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    letter-spacing: 0.02em;
    padding: 10px 14px;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.4);
    border-radius: .6rem;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease;
}
.step-warning.show {
    display: block;
}
.step-warning strong {
    font-weight: 800;
    color: #ff5555;
    display: block;
    margin-bottom: 2px;
}

.step-notice {
    display: none;
    width: 100%;
    margin: 12px 0;
    color: #4ade80;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: .6rem;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease;
}
.step-notice.show {
    display: block;
}
.step-notice strong {
    font-weight: 800;
    color: #4ade80;
    display: block;
    margin-bottom: 2px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================== AUTH CONTAINER ================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.auth-brand {
    margin-bottom: 1.5rem;
    text-align: center;
}
.auth-brand h1 {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}
.auth-tagline {
    font-size: 15px;
    color: #808080;
    letter-spacing: 0.06em;
}

.auth-card {
    background-color: #121212;
    border: 1px solid #808080;
    border-radius: .8rem;
    padding: 2rem 2.2rem;
    width: 480px;
    max-width: 94vw;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #282828;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.auth-tab-btn {
    background: none;
    border: none;
    color: #808080;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.auth-tab-btn:hover {
    color: #ffffff;
}
.auth-tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 2px solid #ffffff;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}
.form-label {
    display: block;
    font-size: 13.5px;
    color: #a0a0a0;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}
.form-input {
    width: 100%;
    background-color: #090909;
    border: 1px solid #383838;
    border-radius: .5rem;
    padding: 11px 14px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}
.form-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* Username input with fixed domain suffix */
.input-with-suffix {
    display: flex;
    align-items: center;
    background-color: #090909;
    border: 1px solid #383838;
    border-radius: .5rem;
    overflow: hidden;
}
.input-with-suffix:focus-within {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
.input-with-suffix input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 11px 14px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}
.input-suffix {
    padding: 11px 14px;
    color: #808080;
    font-size: 15px;
    font-weight: 700;
    background: #141414;
    border-left: 1px solid #282828;
    user-select: none;
}

/* Password rules live checklist */
.password-rules {
    background: #090909;
    border: 1px solid #222222;
    border-radius: .5rem;
    padding: 10px 14px;
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #707070;
}
.rule-item.valid {
    color: #4ade80;
}
.rule-icon {
    font-size: 12px;
    font-weight: bold;
}

/* Submit Button */
.btn-primary {
    width: 100%;
    background-color: #121212;
    border: 1px solid #808080;
    border-radius: .6rem;
    color: #ffffff;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 20px;
    cursor: pointer;
    margin-top: 0.8rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover {
    border-color: #ffffff;
    background-color: #1c1c1c;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #333333;
    color: #808080;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: .4rem;
    cursor: pointer;
}
.btn-secondary:hover {
    color: #ffffff;
    border-color: #808080;
    background: rgba(255, 255, 255, 0.05);
}

/* ================== MAIN MAIL PLATFORM ================== */
.app-container {
    display: none;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000000;
}

/* Top App Bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #0b0b0b;
    border-bottom: 1px solid #222222;
    height: 56px;
}

.top-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-brand h1 {
    font-size: 1.45rem;
    margin: 0;
}

.search-bar-wrapper {
    flex: 1;
    max-width: 540px;
    margin: 0 20px;
    position: relative;
}
.search-input {
    width: 100%;
    background-color: #121212;
    border: 1px solid #333333;
    border-radius: 20px;
    padding: 8px 18px 8px 38px;
    color: #ffffff;
    font-size: 14.5px;
    outline: none;
}
.search-input:focus {
    border-color: #808080;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #666666;
    font-size: 14px;
    pointer-events: none;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #121212;
    border: 1px solid #333333;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13.5px;
    color: #e0e0e0;
}
.user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

/* Mail Layout: 3 Panes (Sidebar, List, Reader) */
.mail-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 1. Left Sidebar */
.sidebar {
    width: 240px;
    min-width: 220px;
    background-color: #070707;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 14px;
}

.compose-btn {
    background-color: #121212;
    border: 1px solid #808080;
    border-radius: 24px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.compose-btn:hover {
    border-color: #ffffff;
    background-color: #1c1c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.15);
}

.nav-folder-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-folder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-radius: 18px;
    color: #909090;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
}
.nav-folder-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.nav-folder-item.active {
    color: #ffffff;
    background-color: #161616;
    border: 1px solid #333333;
    font-weight: 700;
}
.nav-folder-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-badge {
    background: #242424;
    color: #ffffff;
    font-size: 11.5px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}
.nav-badge.unread {
    background: #ffffff;
    color: #000000;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-info-card {
    background: #0f0f0f;
    border: 1px solid #222222;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #707070;
    line-height: 1.4;
}
.sidebar-info-card strong {
    color: #b0b0b0;
}

/* 2. Mail List Pane */
.mail-list-pane {
    width: 380px;
    min-width: 320px;
    background-color: #0a0a0a;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1c1c1c;
    background: #0d0d0d;
}
.list-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 8px;
}
.list-actions {
    display: flex;
    gap: 6px;
}
.icon-btn {
    background: none;
    border: 1px solid transparent;
    color: #808080;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.icon-btn:hover {
    color: #ffffff;
    border-color: #333333;
    background: #141414;
}

.mail-items-container {
    flex: 1;
    overflow-y: auto;
}

.mail-item-row {
    padding: 12px 16px;
    border-bottom: 1px solid #161616;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    background: #0a0a0a;
}
.mail-item-row:hover {
    background: #121212;
}
.mail-item-row.selected {
    background: #171717;
    border-left: 3px solid #ffffff;
}
.mail-item-row.unread {
    background: #111111;
}
.mail-item-row.unread .mail-row-from,
.mail-item-row.unread .mail-row-subject {
    font-weight: 800;
    color: #ffffff;
}

.mail-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mail-row-from {
    font-size: 14px;
    color: #d0d0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.mail-row-date {
    font-size: 12px;
    color: #666666;
    white-space: nowrap;
}

.mail-row-mid {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mail-row-subject {
    font-size: 13.5px;
    color: #a0a0a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.mail-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mail-row-snippet {
    font-size: 12.5px;
    color: #606060;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 270px;
}

/* Bookmark star button */
.star-btn {
    background: none;
    border: none;
    color: #404040;
    cursor: pointer;
    font-size: 17px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
}
.star-btn:hover {
    color: #ffcc00;
    transform: scale(1.15);
}
.star-btn.bookmarked {
    color: #ffcc00;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.badge-spam-tag {
    background: rgba(255, 77, 77, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 77, 77, 0.4);
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* 3. Reader Pane */
.mail-reader-pane {
    flex: 1;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.empty-reader-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #444444;
    gap: 12px;
}
.empty-reader-state svg {
    stroke: #333333;
}

.reader-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid #1a1a1a;
    background: #090909;
}
.reader-tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.reader-btn {
    background: #121212;
    border: 1px solid #333333;
    color: #c0c0c0;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.reader-btn:hover {
    color: #ffffff;
    border-color: #808080;
    background: #1c1c1c;
}
.reader-btn.active {
    border-color: #ffcc00;
    color: #ffcc00;
}

.reader-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.reader-subject {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.reader-header-card {
    background: #0f0f0f;
    border: 1px solid #222222;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.reader-sender-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.reader-from-row {
    font-size: 15px;
    color: #ffffff;
    font-weight: 700;
}
.reader-to-row {
    font-size: 13px;
    color: #777777;
}
.reader-date-info {
    font-size: 13px;
    color: #777777;
    text-align: right;
}

/* Security advisory banners in reader */
.reader-advisory-box {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.45;
}
.reader-advisory-box.spam {
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff6666;
}
.reader-advisory-box.verified {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.reader-body {
    font-size: 16px;
    line-height: 1.65;
    color: #d8d8d8;
    white-space: pre-wrap;
    word-break: break-word;
    background: #070707;
    border: 1px solid #181818;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

/* Quick reply box */
.reader-reply-box {
    margin-top: 10px;
    background: #0e0e0e;
    border: 1px solid #282828;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reply-textarea {
    background: #050505;
    border: 1px solid #333333;
    border-radius: 6px;
    padding: 12px;
    color: #ffffff;
    font-size: 14.5px;
    resize: vertical;
    min-height: 80px;
    outline: none;
}
.reply-textarea:focus {
    border-color: #808080;
}

/* ================== MODALS / OVERLAYS ================== */
.folder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}
.folder-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.dialog-box {
    background-color: #121212;
    border: 1px solid #808080;
    border-radius: .8rem;
    padding: 1.8rem;
    width: 580px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    transform: scale(0.96);
    transition: transform 200ms ease;
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
}
.folder-overlay.active .dialog-box {
    transform: scale(1);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #282828;
}
.dialog-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #ffffff;
    font-weight: 600;
}
.close-btn {
    background: none;
    border: none;
    color: #808080;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.close-btn:hover {
    color: #ffffff;
    background-color: #222222;
}

/* Compose modal specific */
.compose-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #222222;
    padding: 8px 0;
}
.compose-label {
    width: 70px;
    color: #777777;
    font-size: 14px;
    font-weight: 600;
}
.compose-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}
.compose-textarea {
    width: 100%;
    height: 220px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    resize: none;
    padding: 12px 0;
    line-height: 1.6;
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #222222;
}
.bookmark-on-send {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888888;
    font-size: 13.5px;
    cursor: pointer;
}

/* DNS Setup Guide Card */
.dns-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}
.dns-table th, .dns-table td {
    border: 1px solid #282828;
    padding: 8px 10px;
    text-align: left;
}
.dns-table th {
    background: #181818;
    color: #ffffff;
}
.dns-table td {
    color: #a0a0a0;
}

/* Responsive adjustments */
@media screen and (max-width: 900px) {
    .mail-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #222222;
    }
    .mail-list-pane {
        width: 100%;
        height: 350px;
    }
}
