:root {
    --bg-main: #0b0e14;
    --bg-card: #151a23;
    --bg-card-hover: #1e2532;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #00f0ff;
    
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.35);
    --primary-hover: #33f3ff;
    
    --accent: #ffb703;
    --accent-glow: rgba(255, 183, 3, 0.4);
    
    --success: #00e676;
    --danger: #ff3366;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-family: 'Outfit', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 183, 3, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
    line-height: 1.5;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(17, 22, 31, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-badge {
    background: linear-gradient(135deg, #00f0ff, #0077ff);
    color: #050b14;
    font-weight: 800;
    font-size: 16px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 15px var(--primary-glow);
    letter-spacing: 1px;
}

.logo-title {
    display: flex;
    flex-direction: column;
}

.logo-title .brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.logo-title .brand .tld {
    color: var(--primary);
}

.logo-title .sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.25);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.email-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Main Container */
.main-container {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Login View */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 75vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 480px;
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.icon-shield {
    font-size: 40px;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.input-wrapper input,
.modal-form input {
    width: 100%;
    background: #0d1117;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.25s ease;
}

.input-wrapper input:focus,
.modal-form input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.btn-toggle-eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-toggle-eye:hover {
    opacity: 1;
}

.alert-box {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
}

.alert-error {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.35);
    color: #ff6b8b;
}

.alert-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.35);
    color: #4ade80;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0077ff);
    color: #050b14;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #1a88ff);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.btn-danger-outline {
    background: rgba(255, 51, 102, 0.05);
    border: 1px solid rgba(255, 51, 102, 0.2);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: rgba(255, 51, 102, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.login-guide {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.guide-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-guide ul {
    list-style: none;
}

.login-guide li {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    position: relative;
    padding-left: 14px;
}

.login-guide li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Mailbox View */
.mailbox-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Hero OTP Card */
.hero-otp-card {
    background: linear-gradient(135deg, rgba(21, 26, 35, 0.95), rgba(30, 37, 50, 0.95));
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    position: relative;
    box-shadow: 0 10px 30px var(--accent-glow);
    animation: glowCard 2s infinite alternate;
}

@keyframes glowCard {
    0% { border-color: rgba(255, 183, 3, 0.6); box-shadow: 0 5px 20px rgba(255, 183, 3, 0.2); }
    100% { border-color: rgba(255, 183, 3, 1); box-shadow: 0 8px 30px rgba(255, 183, 3, 0.45); }
}

.otp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.badge-fire {
    font-weight: 800;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 1px;
}

.otp-time {
    font-size: 12px;
    color: var(--text-muted);
}

.otp-code-box {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.hero-otp-digits {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 8px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 20px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--primary);
}

.btn-copy {
    background: linear-gradient(135deg, var(--accent), #ff9100);
    color: #0b0e14;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 15px rgba(255, 183, 3, 0.4);
}

.btn-copy:hover {
    background: linear-gradient(135deg, #ffc425, #ffa01a);
    transform: scale(1.03);
}

.otp-note {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Inbox Layout */
.inbox-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    height: 68vh;
    min-height: 520px;
}

.message-list-panel,
.message-reader-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
}

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

.empty-notice {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-notice p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-notice span {
    font-size: 12px;
}

.msg-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-item:hover {
    background: var(--bg-card-hover);
}

.msg-item.active {
    background: rgba(0, 240, 255, 0.08);
    border-left: 3px solid var(--primary);
}

.msg-item.unread .msg-subject {
    font-weight: 700;
    color: #fff;
}

.msg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.msg-from {
    font-weight: 600;
    color: var(--primary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-subject {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msg-otp-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 183, 3, 0.15);
    border: 1px solid rgba(255, 183, 3, 0.3);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    align-self: flex-start;
}

/* Reader Panel */
.reader-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.6;
}

.reader-placeholder h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.reader-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.reader-subject {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.reader-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.reader-otp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}

.reader-otp-row span {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.reader-otp-code {
    font-size: 20px;
    font-family: monospace;
    letter-spacing: 3px;
    color: #fff;
}

.reader-body {
    flex: 1;
    overflow: hidden;
    background: #ffffff;
}

.email-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 440px;
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.btn-close:hover {
    color: #fff;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    border: 1px solid var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.3);
    font-size: 14px;
    font-weight: 600;
    z-index: 300;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .inbox-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .message-list-panel {
        max-height: 380px;
    }

    .message-reader-panel {
        min-height: 400px;
    }

    .hero-otp-digits {
        font-size: 32px;
        letter-spacing: 4px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .user-header {
        width: 100%;
        justify-content: space-between;
    }
}
