/* =============================================
   MT>3 Ediscovery Portals — Brutalist + Orange
   Built on Bootstrap 5 Grid System
   ============================================= */

:root {
    /* Orange palette */
    --mto-50: #fff7ed;
    --mto-100: #ffedd5;
    --mto-200: #fed7aa;
    --mto-300: #fdba74;
    --mto-400: #fb923c;
    --mto-500: #f97316;
    --mto-600: #ea580c;
    --mto-700: #c2410c;
    --mto-800: #9a3412;
    --mto-900: #7c2d12;

    /* Neutrals */
    --mto-bg: #f9f9f9;
    --mto-surface: #ffffff;
    --mto-text: #1a1c1c;
    --mto-muted: #5e5e5e;
    --mto-border: #e2bfb0;
    --mto-shadow: rgba(0, 0, 0, 1);

    /* Spacing */
    --mto-unit: 4px;
    --mto-xs: calc(var(--mto-unit) * 1);
    --mto-sm: calc(var(--mto-unit) * 2);
    --mto-md: calc(var(--mto-unit) * 4);
    --mto-lg: calc(var(--mto-unit) * 6);
    --mto-xl: calc(var(--mto-unit) * 10);

    --font-geist: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

/* -------------------------------------------
   RESET & GLOBALS
   ----------------------------------------- */
* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    font-family: var(--font-geist);
    background-color: var(--mto-bg);
    color: var(--mto-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    flex-shrink: 0;
}

main.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Support page overrides — center form box both ways */
main.container.justify-content-center {
    flex-direction: row;
}

.main-centered {
    width: 100%;
}

::selection {
    background-color: var(--mto-600);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e2e2; }
::-webkit-scrollbar-thumb:hover { background: var(--mto-600); }

/* -------------------------------------------
   UTILITY CLASSES
   ----------------------------------------- */
.font-geist   { font-family: var(--font-geist); }
.font-mono    { font-family: var(--font-mono); }
.text-orange  { color: var(--mto-600); }
.text-muted   { color: var(--mto-muted) !important; }

/* -------------------------------------------
   NAVBAR
   ----------------------------------------- */
.app-navbar {
    background: var(--mto-surface);
    border-bottom: 1px solid var(--mto-border);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 10px 0;
}

.navbar-brand-container {
    display: inline-block;
}

.brand-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Language toggle — brutalist pill matching platform-card action bar */
.btn-lang {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--mto-600);
    border: none;
    border-radius: 0;
    padding: 0.45em 1em;
    cursor: pointer;
    line-height: 1;
    box-shadow: 3px 3px 0 0 var(--mto-900);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

.btn-lang:hover,
.btn-lang:focus-visible {
    background: var(--mto-700);
    outline: none;
}

.btn-lang:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--mto-md);
}

/* -------------------------------------------
   HERO BLOCK
   ----------------------------------------- */
.hero-block-centered {
    padding: 4px 0;
}

.hero-block {
    border-left: 4px solid var(--mto-600);
    padding-left: var(--mto-md);
    padding-top: var(--mto-sm);
    padding-bottom: var(--mto-sm);
}

.hero-title {
    font-family: var(--font-geist);
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin: 0;
    color: var(--mto-text);
}

.hero-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: var(--mto-muted);
    margin: 2px 0 0 0;
}

/* -------------------------------------------
   PLATFORM CARDS — Large, prominent, with orange CTA button
   ----------------------------------------- */
.platform-card {
    background: var(--mto-surface);
    border: 2px solid var(--mto-text);
    padding: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0 0 var(--mto-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
    min-height: 280px;
    text-decoration: none;
    color: var(--mto-text);
    position: relative;
}

.platform-card:hover {
    box-shadow: 6px 6px 0 0 var(--mto-600);
    transform: translate(-2px, -2px);
    color: var(--mto-text);
    border-color: var(--mto-600);
}

.platform-card:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.platform-card:focus-visible {
    outline: 3px solid var(--mto-600);
    outline-offset: 2px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.platform-icon-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: filter 0.2s ease;
}

.platform-card:hover .platform-icon-img {
    /* Subtle effect on hover */
}

.status-badge {
    background: #eeeeee;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    text-transform: uppercase;
    color: #5a4136;
    line-height: 1;
}

.card-platform-name {
    font-family: var(--font-geist);
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

.card-description {
    font-size: 13px;
    line-height: 1.4;
    color: var(--mto-muted);
    margin: 0;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-geist);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: white;
    background: var(--mto-600);
    padding: 14px 20px;
    transition: background 0.2s ease;
    margin-top: auto;
}

.platform-card:hover .card-action {
    background: var(--mto-700);
    gap: 12px;
}

/* Responsive card adjustments */
@media (max-width: 767.98px) {
    .platform-card {
        padding: 20px;
        gap: 12px;
        min-height: 240px;
    }
    .card-platform-name {
        font-size: 22px;
    }
    .card-action {
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* -------------------------------------------
   HELP SECTION — Muted gray
   ----------------------------------------- */
.help-section {
    background: #eeeeee;
    color: var(--mto-text);
    padding: var(--mto-lg);
    border: 1px solid #dddddd;
}

.help-title {
    font-family: var(--font-geist);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--mto-text);
}

.help-text {
    color: var(--mto-muted);
    margin: 4px 0 0 0;
    font-size: 13px;
}

.btn-help {
    background: var(--mto-600);
    color: white;
    border: none;
    padding: 12px 28px;
    font-family: var(--font-geist);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-help:hover {
    background: var(--mto-700);
    color: white;
}

.btn-help:active {
    transform: translateY(1px);
}

/* -------------------------------------------
   SUPPORT FORM PAGE
   ----------------------------------------- */
.support-form-container {
    width: 100%;
    max-width: 780px;
    background: var(--mto-surface);
    border: 1px solid var(--mto-border);
    padding: var(--mto-lg);
}

@media (min-width: 768px) {
    .support-form-container {
        padding: 36px;
    }
}

.form-heading {
    font-family: var(--font-geist);
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    color: var(--mto-text);
}

.form-subtitle {
    font-size: 13px;
    line-height: 1.5;
    color: var(--mto-muted);
    margin: 0;
}

/* Custom form label */
.form-label-custom {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mto-text);
    margin-bottom: 4px;
}

/* Custom input */
.form-control-custom {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-geist);
    font-size: 14px;
    line-height: 1.5;
    color: var(--mto-text);
    background: #f3f3f3;
    border: 1px solid #e2e2e2;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-custom::placeholder {
    color: #9a9898;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--mto-600);
    box-shadow: 4px 4px 0 0 rgba(255, 107, 0, 0.1);
}

textarea.form-control-custom {
    resize: none;
}

/* Custom select wrapper */
.custom-select-wrapper {
    position: relative;
}

.form-select-custom {
    display: block;
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-family: var(--font-geist);
    font-size: 14px;
    line-height: 1.5;
    color: var(--mto-text);
    background: #f3f3f3;
    border: 1px solid #e2e2e2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.form-select-custom:focus {
    outline: none;
    border-color: var(--mto-600);
    box-shadow: 4px 4px 0 0 rgba(255, 107, 0, 0.1);
}

.custom-select-icon {
    position: absolute;
    right: var(--mto-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--mto-muted);
    pointer-events: none;
    font-size: 18px;
}

/* Turnstile container */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* Submit button */
.btn-submit {
    background: var(--mto-600);
    color: white;
    border: none;
    padding: 16px;
    font-family: var(--font-geist);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    transition: background 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mto-sm);
}

.btn-submit:hover {
    background: var(--mto-700);
    color: white;
}

.btn-submit:active {
    transform: translateY(1px);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Invalid feedback */
.invalid-feedback {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #ba1a1a;
    margin-top: var(--mto-xs);
}

.was-validated .form-control-custom:invalid,
.was-validated .form-select-custom:invalid {
    border-color: #ba1a1a;
}

/* -------------------------------------------
   LOADING / ERROR STATES
   ----------------------------------------- */
#loadingState .spinner-grow {
    background-color: var(--mto-600);
}

/* -------------------------------------------
   MOTION REDUCTION
   ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .platform-card:hover {
        transform: none;
    }
}

/* -------------------------------------------
   HIGH CONTRAST
   ----------------------------------------- */
@media (prefers-contrast: high) {
    .platform-card {
        border-width: 3px;
    }
}

/* -------------------------------------------
   PRINT
   ----------------------------------------- */
@media print {
    .app-navbar, .app-footer, .btn-help { display: none; }
    .platform-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: white; }
}