@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-page: #0a090e;
    --bg-surface: #121019;
    --bg-surface-elevated: #1a1626;
    --bg-input: #0e0d15;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(217, 70, 239, 0.4);
    --border-active: #d946ef;
    
    --text-primary: #ffffff;
    --text-secondary: #9490a6;
    --text-muted: #656178;
    
    /* Magenta / Violet Theme */
    --accent-magenta: #d946ef;
    --accent-magenta-hover: #c026d3;
    --accent-magenta-glow: rgba(217, 70, 239, 0.35);
    --accent-violet: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #d946ef 0%, #8b5cf6 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(217, 70, 239, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-magenta: 0 0 20px rgba(217, 70, 239, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(217, 70, 239, 0.15), transparent),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08), transparent);
    background-attachment: fixed;
}

/* Header / Navbar */
.navbar {
    border-bottom: 1px solid var(--border);
    background: rgba(18, 16, 25, 0.7);
    backdrop-filter: blur(16px);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-magenta);
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(217, 70, 239, 0.15);
    color: #f0abfc;
    border: 1px solid rgba(217, 70, 239, 0.3);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.live-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 1.5s infinite;
}

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

/* Layout */
.app-container {
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 20px 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero / Header text */
.hero {
    text-align: center;
    margin-bottom: 6px;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
}

.hero p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Cards (cheapestprices style) */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: rgba(217, 70, 239, 0.25);
}

/* Active Email Box */
.active-mail-card {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
    border-color: rgba(217, 70, 239, 0.3);
}

.active-mail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-mail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #f0abfc;
}

.email-display-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    gap: 14px;
    transition: all 0.2s;
}

.email-display-bar:focus-within {
    border-color: var(--accent-magenta);
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.2);
}

.email-address {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    word-break: break-all;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(217, 70, 239, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.5);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #231e33;
    border-color: var(--border-hover);
}

.btn-magenta-outline {
    background: rgba(217, 70, 239, 0.1);
    color: #f0abfc;
    border: 1px solid rgba(217, 70, 239, 0.3);
}

.btn-magenta-outline:hover {
    background: rgba(217, 70, 239, 0.2);
    border-color: var(--accent-magenta);
}

/* Buscador de bandeja (cheapestprices.xyz/entrar style) */
.lookup-section {
    padding: 20px 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-surface);
}

.lookup-text h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.lookup-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.lookup-form {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 440px;
}

.field {
    flex: 1;
    height: 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: white;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.field:focus {
    border-color: var(--accent-magenta);
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.25);
}

/* Inbox & Messages Section */
.inbox-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 520px;
}

@media (max-width: 820px) {
    .inbox-grid {
        grid-template-columns: 1fr;
    }
}

.inbox-left {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
}

.inbox-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface-elevated);
}

.inbox-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-counter {
    background: var(--accent-magenta);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    max-height: 520px;
}

.msg-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-surface);
}

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

.msg-item.active {
    background: #201a30;
    border-left: 3px solid var(--accent-magenta);
}

.msg-item.unread {
    background: rgba(217, 70, 239, 0.05);
}

.msg-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.msg-sender {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.msg-date {
    font-size: 11px;
    color: var(--text-muted);
}

.msg-subject {
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Reading Pane */
.inbox-right {
    background: var(--bg-surface-elevated);
    padding: 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.reading-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.mail-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mail-subject {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.mail-info-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: var(--shadow-magenta);
}

.mail-info-meta {
    flex: 1;
}

.mail-from {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.mail-from span {
    color: #f0abfc;
}

.mail-to {
    font-size: 12px;
    color: var(--text-secondary);
}

/* OTP Code Box (Magenta Highlight) */
.otp-card {
    background: var(--accent-gradient-subtle);
    border: 1px solid rgba(217, 70, 239, 0.4);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.15);
}

.otp-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.otp-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #f0abfc;
}

.otp-code {
    font-family: monospace;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 5px;
    color: #fff;
    text-shadow: 0 0 10px rgba(217, 70, 239, 0.8);
}

.mail-content {
    font-size: 14px;
    line-height: 1.8;
    color: #d1d5db;
    white-space: pre-wrap;
    padding-top: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f1b2e;
    color: white;
    border: 1px solid rgba(217, 70, 239, 0.4);
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    z-index: 999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}
