/**
 * Main stylesheet for Moog Email Builder
 * Uses Moog branding guidelines and color palette
 */

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

body {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--moog-dark, #1A1A1A);
    background-color: var(--moog-off-white, #F4F4F4);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, var(--moog-maroon, #87212E) 0%, #6B1924 100%);
    color: var(--moog-white, #FFFFFF);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 80px 80px 0;
    border-color: transparent rgba(255,255,255,0.1) transparent transparent;
}

.header h1 {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.header p {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

.main-content {
    background: var(--moog-white, #FFFFFF);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(135, 33, 46, 0.1);
    margin-bottom: 30px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
}

.main-content h2 {
    color: var(--moog-maroon, #87212E);
    font-weight: 600;
    margin-bottom: 20px;
}

.main-content h3 {
    color: var(--moog-maroon, #87212E);
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 30px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.action-card {
    background: var(--moog-white, #FFFFFF);
    border: 1px solid var(--moog-cool-gray, #DCDDDE);
    border-radius: 6px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--moog-maroon, #87212E) 0%, var(--moog-blue, #5E82AB) 100%);
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(135, 33, 46, 0.15);
    border-color: var(--moog-maroon, #87212E);
}

.action-card h3 {
    color: var(--moog-maroon, #87212E);
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
}

.action-card p {
    color: var(--moog-gray, #94877A);
    margin-bottom: 20px;
    line-height: 1.6;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
}

.btn {
    background: var(--moog-maroon, #87212E);
    color: var(--moog-white, #FFFFFF);
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #6B1924;
    color: var(--moog-white, #FFFFFF);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--moog-maroon, #87212E);
    border: 2px solid var(--moog-maroon, #87212E);
}

.btn-secondary:hover {
    background: var(--moog-maroon, #87212E);
    color: var(--moog-white, #FFFFFF);
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.features-list {
    list-style: none;
    margin: 20px 0;
}

.features-list li {
    padding: 8px 0;
    color: #495057;
}

.features-list li:before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-right: 8px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--moog-gray, #94877A);
    border-top: 1px solid var(--moog-cool-gray, #DCDDDE);
    margin-top: 40px;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 12px;
}

/* Drafts list on the home page. */
.drafts-list {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}
.drafts-list h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--moog-maroon, #87212E);
    margin-bottom: 14px;
}
.drafts-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.drafts-list li {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #eeeeee;
}
.drafts-list li a {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    color: #333333;
    text-decoration: none;
}
.drafts-list li a:hover {
    background: #fafafa;
}
.drafts-list .draft-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.drafts-list .draft-name {
    font-weight: 600;
    font-size: 14px;
}
.drafts-list .draft-meta {
    font-size: 12px;
    color: #888888;
}
/* Inline pill showing the draft has left the app. Sent wins over
   exported — it's the stronger "safe to delete" signal. */
.drafts-list .draft-status {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f0;
    color: #666666;
}
.drafts-list .draft-status-sent {
    background: #e2f4e6;
    color: #2c6b35;
}
.drafts-list .draft-status-exported {
    background: #eef0f7;
    color: #4a5273;
}
.draft-delete {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #b0b0b0;
    font-size: 20px;
    line-height: 1;
    width: 36px;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.draft-delete:hover {
    color: var(--moog-maroon, #87212E);
    background: #f5e9eb;
}
.draft-delete:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px;
    }
}
/* ── Help page ───────────────────────────────────────────── */
.help-content {
    line-height: 1.55;
}
.help-content h2 {
    color: var(--moog-maroon, #87212E);
    margin-top: 28px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #DCDDDE;
}
.help-content section + section { margin-top: 8px; }
.help-content code {
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.92em;
}
.help-toc {
    background: #f7efe6;
    border: 1px solid #e7d8c8;
    padding: 14px 18px;
    margin-bottom: 26px;
    border-radius: 4px;
}
.help-toc ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.help-toc a { color: var(--moog-maroon, #87212E); }
.help-content .placeholder {
    color: #888;
    font-style: italic;
}
.help-back { margin-top: 36px; }

/* ── Top nav (moog.com-inspired) ──────────────────────────
   Maroon horizontal bar with white wordmark on the left, menu
   in the center/right, user info on the far right. Compact —
   ~52px tall — so it sits low-profile above the page content. */
.topnav {
    background: var(--moog-maroon, #87212E);
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 28px;
    min-height: 52px;
    font-family: var(--moog-font-family, 'Open Sans', Arial, sans-serif);
    position: relative;
    z-index: 100;
}
.topnav-logo {
    display: flex;
    align-items: baseline;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    margin-right: 36px;
}
.topnav-logo img {
    height: 22px;
    width: auto;
    display: block;
    align-self: center;
}
.topnav-product {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    border-left: 1px solid rgba(255,255,255,0.25);
    padding-left: 12px;
    align-self: center;
}
.topnav-menu {
    flex: 1;
}
.topnav-menu > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 4px;
}
.topnav-menu > ul > li {
    position: relative;
    display: flex;
    align-items: stretch;
}
.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0 18px;
    min-height: 52px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.topnav-link:hover,
.topnav-link:focus {
    background: rgba(255,255,255,0.1);
    outline: none;
}
.topnav-menu li.is-active .topnav-link,
.topnav-menu .topnav-link[aria-current="page"] {
    background: rgba(0,0,0,0.18);
}
.topnav-caret {
    font-size: 9px;
    line-height: 1;
    opacity: 0.8;
    transform: translateY(1px);
}

/* Submenu — CSS-only reveal on hover/focus. No JS. */
.topnav-submenu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #ffffff;
    color: #333333;
    border: 1px solid #DCDDDE;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    display: none;
    z-index: 110;
}
.topnav-has-submenu:hover > .topnav-submenu,
.topnav-has-submenu:focus-within > .topnav-submenu {
    display: block;
}
.topnav-submenu a {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
    color: #333333;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.topnav-submenu a:hover,
.topnav-submenu a:focus {
    background: var(--moog-maroon, #87212E);
    color: #ffffff;
    outline: none;
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
}
.topnav-user-name {
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    letter-spacing: 0.04em;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topnav-signout {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 12px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.topnav-signout:hover,
.topnav-signout:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.7);
    outline: none;
}

/* ── Page heading (replaces the old giant gradient header) ── */
.page-heading {
    background: #ffffff;
    border-bottom: 1px solid #DCDDDE;
    padding: 28px 36px 24px 36px;
}
.page-heading h1 {
    font-family: var(--moog-font-family, 'Open Sans', Arial, sans-serif);
    font-size: 26px;
    font-weight: 300;
    color: var(--moog-maroon, #87212E);
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1.2;
}
.page-heading h1 strong { font-weight: 700; }
.page-heading p {
    margin: 6px 0 0 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .topnav { flex-wrap: wrap; padding: 0 14px; }
    .topnav-product { display: none; }
    .topnav-user-name { max-width: 130px; }
}

/* ── Login screen ─────────────────────────────────────────
   Full-viewport split: Moog building photo on the left,
   sign-in panel on the right. Wraps to a stacked layout
   below 900px. */

.login-body {
    margin: 0;
    background: #ffffff;
    font-family: var(--moog-font-family, 'Open Sans', Arial, sans-serif);
    color: #333333;
}

.login-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left: full-bleed building photo with a subtle maroon-tinted overlay
   so the brand color carries through even when the form panel is
   off-screen on narrow viewports. */
.login-hero {
    flex: 1 1 50%;
    position: relative;
    background-image: url('/img/moog-building.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.login-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(135, 33, 46, 0.22) 0%,
        rgba(26, 26, 26, 0.18) 60%,
        rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}
.login-hero-tagline {
    position: absolute;
    bottom: 36px;
    left: 36px;
    right: 36px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Right: white panel with the brand row, form, and footer. */
.login-panel {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 48px 60px;
    max-width: 680px;
    overflow-y: auto;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--moog-cool-gray, #DCDDDE);
}
.login-brand img {
    height: 28px;
    width: auto;
    display: block;
}
.login-brand-divider {
    width: 1px;
    height: 22px;
    background: var(--moog-cool-gray, #DCDDDE);
}
.login-brand-product {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--moog-gray, #94877A);
}

.login-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0;
    max-width: 440px;
}

.login-form-wrap h1 {
    font-family: var(--moog-font-family);
    font-size: 36px;
    font-weight: 300;
    color: var(--moog-maroon, #87212E);
    letter-spacing: 0.01em;
    margin: 0 0 10px 0;
    line-height: 1.15;
}
.login-form-wrap h1 strong {
    font-weight: 700;
}

.login-lede {
    color: #555555;
    line-height: 1.6;
    font-size: 15px;
    margin: 0 0 28px 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-form label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--moog-gray, #94877A);
    margin-bottom: -2px;
}
.login-form input[type="email"] {
    padding: 13px 14px;
    border: 1px solid var(--moog-cool-gray, #DCDDDE);
    border-radius: 3px;
    font-size: 15px;
    font-family: inherit;
    color: #1A1A1A;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-form input[type="email"]:focus {
    outline: none;
    border-color: var(--moog-maroon, #87212E);
    box-shadow: 0 0 0 3px rgba(135, 33, 46, 0.15);
}
.login-form input[type="email"]::placeholder {
    color: #aaaaaa;
}

.login-submit {
    margin-top: 12px;
    padding: 14px 22px;
    font-size: 12px;
    letter-spacing: 0.14em;
    width: 100%;
    cursor: pointer;
}

.login-help {
    margin-top: 22px;
    color: #777777;
    font-size: 13px;
    line-height: 1.6;
}

.login-footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--moog-cool-gray, #DCDDDE);
    color: #888888;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.login-footer p { margin: 0; }

/* Below 900px, stack the layout: building image becomes a banner. */
@media (max-width: 900px) {
    .login-split { flex-direction: column; min-height: 100vh; }
    .login-hero {
        flex: 0 0 220px;
        min-height: 220px;
    }
    .login-hero-tagline { font-size: 11px; bottom: 18px; left: 20px; right: 20px; }
    .login-panel {
        flex: 1;
        max-width: none;
        padding: 36px 32px;
    }
    .login-form-wrap { max-width: none; padding: 16px 0; }
    .login-form-wrap h1 { font-size: 28px; }
}

/* Tight phone widths. */
@media (max-width: 520px) {
    .login-hero { flex: 0 0 160px; min-height: 160px; }
    .login-panel { padding: 24px 20px; }
    .login-form-wrap h1 { font-size: 24px; }
}
