/* ═══════════════════════════════════════════════════
 *  MacBurguer Mail — Stylesheet
 *  Dark theme · Purple accent · Modern minimal UI
 * ═══════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #141111;
    --bg-card: #1a1616;
    --bg-input: #241f1f;

    --accent: #e11d48;
    --accent-hover: #fb7185;
    --accent-glow: rgba(225, 29, 72, 0.35);
    --accent-subtle: rgba(225, 29, 72, 0.08);
    --accent-gradient: linear-gradient(135deg, #9f1239, #e11d48);

    --text-primary: #fcfcfc;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;

    --border: rgba(255, 255, 255, 0.04);
    --border-input: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(225, 29, 72, 0.5);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 24px var(--accent-glow);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════
 *  LOGIN PAGE
 * ═══════════════════════════════════════════════════ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(225, 29, 72, 0.1) 0%, transparent 60%),
        var(--bg-primary);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Card */
.login-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px 36px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

/* Subtle top-edge glow */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.6;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    width: 150px;
    /* Enhanced size for the new realistic version */
    height: auto;
    display: block;
    margin: 0 auto 12px auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.04) translateY(-2px);
}

.logo.spin {
    animation: quickSpin 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes quickSpin {
    from {
        transform: rotate(0deg) scale(1.04);
    }

    to {
        transform: rotate(360deg) scale(1.04);
    }
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-group input {
    width: 100%;
    padding: 10px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 30px;
    /* Pill-shaped inputs */
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    padding: 11px 0;
    margin-top: 4px;
    font-size: 0.875rem;
    color: #fff;
    background: var(--accent-gradient);
    border-radius: 30px;
    /* Pill-shaped button */
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px var(--accent-glow), var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-hint {
    margin-top: 14px;
    font-size: 0.65rem;
    /* Smaller hint as in photo */
    color: var(--text-muted);
    text-align: center;
    opacity: 0.7;
    font-weight: 500;
}

/* ─── Alerts ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Footer */
.footer-text {
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
 *  INBOX PAGE
 * ═══════════════════════════════════════════════════ */

.inbox-page {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        var(--bg-primary);
}

/* Header Bar */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Small buttons */
.btn-small {
    padding: 7px 16px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-refresh {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
}

.btn-refresh:hover {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-color: var(--border-focus);
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-input);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Inbox container */
.inbox-container {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 24px;
}

/* Email card */
.email-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    box-shadow: var(--shadow-card);
    animation: fadeIn 0.4s ease;
}

.email-meta p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    word-break: break-word;
}

.email-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.email-body {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Ensure images inside email body are responsive */
.email-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Plain text links in email body */
.email-body a {
    color: var(--accent-hover);
    text-decoration: underline;
    transition: color var(--transition);
}

.email-body a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════
 *  Animations
 * ═══════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
 *  Responsive
 * ═══════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .login-card {
        padding: 32px 24px 28px;
    }

    .header-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .user-email {
        width: 100%;
        text-align: center;
        font-size: 0.75rem;
    }

    .inbox-container {
        margin-top: 24px;
        padding: 0 12px;
    }

    .email-card {
        padding: 24px 20px;
    }
}