/* global.css - Shared across index.html, dashboard.html, and registration.html */

/* =========================================================
   CORE VARIABLES & PLATFORM PALETTE
========================================================= */
:root {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); 
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --accent: #f59e0b;
    --success: #10b981; 
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --header-gradient: linear-gradient(135deg, #0f172a, #1e293b);
    --hero-bg: linear-gradient(135deg, rgba(14,165,233,0.06) 0%, rgba(241,245,249,1) 100%);
}

/* =========================================================
   GLOBAL RESET & BASICS
========================================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body { 
    background: var(--bg-gradient); 
    color: var(--text-main); 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    line-height: 1.5; 
    overflow-x: hidden; /* CRITICAL FIX: Eliminates desktop horizontal scrollbar bounce */
}

/* =========================================================
   STICKY APPLICATION HEADER
========================================================= */
header { 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: var(--header-gradient); 
    color: white; 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 12px rgba(15,23,42,0.08); 
}
.header-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
    max-width: 1100px; 
    margin: 0 auto; 
}
.logo { 
    font-size: 22px; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    letter-spacing: -0.5px; 
    text-decoration: none; 
    color: white;
}

/* =========================================================
   UI ACTION ELEMENTS (BUTTONS)
========================================================= */
.btn-outline-light { 
    background: transparent; 
    color: white; 
    border: 2px solid rgba(255,255,255,0.4); 
    padding: 8px 18px; 
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 14px; 
    cursor: pointer; 
    transition: 0.2s; 
}
.btn-outline-light:hover { 
    background: rgba(255,255,255,0.1); 
    border-color: white; 
}
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    padding: 16px 32px; 
    font-size: 16px; 
    font-weight: 700; 
    text-decoration: none; 
    border-radius: 10px; 
    transition: 0.2s; 
    border: none; 
    cursor: pointer; 
}
.btn-primary { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 4px 14px rgba(14,165,233,0.3); 
}
.btn-primary:hover { 
    background: var(--primary-hover); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(14,165,233,0.4); 
}
.btn-secondary { 
    background: white; 
    color: #334155; 
    border: 2px solid var(--border); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}
.btn-secondary:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    transform: translateY(-2px); 
}
.btn-logout { 
    background: rgba(255,255,255,0.15); 
    border: none; 
    color: white; 
    padding: 6px 14px; 
    border-radius: 8px; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.btn-logout:hover { 
    background: rgba(255,255,255,0.25); 
    color: #fee2e2; 
}

/* =========================================================
   CONTAINERS SHAPE ARCHITECTURE
========================================================= */
.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 24px; 
    width: 100%; 
    flex-grow: 1; 
}
.dashboard-container { 
    max-width: 900px; 
    margin: 40px auto; 
    padding: 0 20px; 
    flex-grow: 1; 
    width: 100%; 
}

/* =========================================================
   HERO BANNER MODULE (index.html)
========================================================= */
.hero { 
    padding: 90px 0 80px; 
    background: var(--hero-bg); 
    text-align: center; 
    border-radius: 0 0 32px 32px; 
    margin-bottom: 50px; 
    border-bottom: 1px solid var(--border); 
}
.hero h1 { 
    font-size: clamp(34px, 5vw, 52px); 
    font-weight: 800; 
    margin-bottom: 20px; 
    line-height: 1.1; 
    letter-spacing: -1.5px; 
    color: #0f172a; 
}
.hero h1 span { 
    color: var(--primary); 
}
.hero p { 
    font-size: clamp(16px, 2.5vw, 19px); 
    color: var(--text-muted); 
    max-width: 720px; 
    margin: 0 auto 32px; 
    line-height: 1.6; 
}
.security-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 16px; 
    border-radius: 30px; 
    font-size: 13px; 
    font-weight: 700; 
    background: white; 
    color: #10b981; 
    border: 1px solid #bbf7d0; 
    box-shadow: 0 4px 6px -1px rgba(16,185,129,0.05); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.action-group { 
    display: flex; 
    gap: 16px; 
    justify-content: center; 
    flex-wrap: wrap; 
    margin-bottom: 24px; 
}

/* =========================================================
   WORKSPACE COMMAND HUB COMPONENTS (dashboard.html)
========================================================= */
.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}
.user-salutation { 
    font-size: 14px; 
    font-weight: 600; 
    color: #cbd5e1; 
    background: rgba(255,255,255,0.06); 
    padding: 6px 14px; 
    border-radius: 50px; 
    border: 1px solid rgba(255,255,255,0.1); 
}
.page-header { 
    margin-bottom: 24px; 
}
.page-header h1 { 
    font-size: 28px; 
    font-weight: 700; 
    color: #0f172a; 
    margin-bottom: 4px; 
}
.page-header p { 
    color: #64748b; 
    font-size: 15px; 
}
.tier-badge { 
    background: #f1f5f9; 
    color: #475569; 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
    border: 1px solid #cbd5e1; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.tier-badge.premium { 
    background: #fef3c7; 
    color: #b45309; 
    border-color: #fde68a; 
}
.section-title { 
    font-size: 14px; 
    font-weight: 700; 
    color: #475569; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin: 35px 0 16px; 
    padding-bottom: 8px; 
    border-bottom: 2px solid #e2e8f0; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}
.index-section-title { 
    text-align: center; 
    font-size: 30px; 
    font-weight: 800; 
    margin-bottom: 12px; 
    letter-spacing: -0.5px; 
    color: #0f172a; 
}
.index-section-subtitle { 
    text-align: center; 
    color: var(--text-muted); 
    font-size: 16px; 
    max-width: 500px; 
    margin: 0 auto 45px; 
    line-height: 1.4; 
}

/* =========================================================
   GRID & CARD PLATFORM SCHEMAS
========================================================= */
.tools-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 24px; 
}
.features-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 24px; 
    margin-bottom: 80px; 
}

.tool-card { 
    background: white; 
    border-radius: 16px; 
    padding: 24px; 
    border: 1px solid var(--border); 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    text-decoration: none; 
    color: inherit; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 20px; 
    position: relative; 
}
.tool-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 20px -5px rgba(0,0,0,0.08); 
    border-color: #cbd5e1; 
}
.feature-card { 
    background: white; 
    border-radius: 16px; 
    padding: 32px 24px; 
    border: 1px solid var(--border); 
    transition: 0.2s; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); 
    display: flex; 
    flex-direction: column; 
}
.feature-card:hover { 
    transform: translateY(-4px); 
    border-color: var(--primary); 
    box-shadow: 0 12px 24px -10px rgba(14,165,233,0.15); 
}

/* =========================================================
   ELEMENT CONTENT ICONS & BADGES
========================================================= */
.tool-icon { 
    width: 56px; 
    height: 56px; 
    border-radius: 14px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 26px; 
    flex-shrink: 0; 
}
.tool-icon.blue { background: #e0f2fe; color: #0284c7; }
.tool-icon.purple { background: #f3e8ff; color: #7e22ce; }
.tool-icon.yellow { background: #fef3c7; color: #b45309; }
.tool-icon.red { background: #fee2e2; color: var(--danger); }

.feature-icon-wrapper { 
    width: 48px; 
    height: 48px; 
    border-radius: 10px; 
    background: #f0f9ff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 20px; 
}
.feature-icon { 
    font-size: 24px; 
    color: var(--primary); 
}
.tool-text-content { 
    flex-grow: 1; 
}
.tool-title, .feature-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #0f172a; 
    margin-bottom: 4px; 
}
.feature-title { 
    margin-bottom: 10px; 
}
.tool-desc, .feature-desc { 
    font-size: 14px; 
    color: #64748b; 
    line-height: 1.4; 
}
.feature-desc { 
    line-height: 1.5; 
    flex-grow: 1; 
}
.tool-arrow { 
    font-size: 18px; 
    color: #94a3b8; 
    transition: 0.2s; 
}
.tool-card:hover .tool-arrow { 
    color: #0f172a; 
    transform: translateX(3px); 
}
.premium-text { 
    display: inline-flex; 
    align-items: center; 
    gap: 4px; 
    margin-top: 16px; 
    font-size: 11px; 
    font-weight: 700; 
    color: #b45309; 
    background: #fef3c7; 
    padding: 4px 8px; 
    border-radius: 6px; 
    text-transform: uppercase; 
    align-self: flex-start; 
    letter-spacing: 0.5px; 
    border: 1px solid #fde68a; 
}

/* =========================================================
   ECOSYSTEM DISPLAY STRIPS (index.html)
========================================================= */
.ecosystem-banner { 
    background: #0f172a; 
    color: white; 
    border-radius: 20px; 
    padding: 40px; 
    margin-bottom: 8px; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    align-items: center; 
}
.eco-text h3 { 
    font-size: 24px; 
    font-weight: 700; 
    margin-bottom: 12px; 
    letter-spacing: -0.5px; 
}
.eco-text p { 
    color: #94a3b8; 
    font-size: 15px; 
    line-height: 1.6; 
}
.eco-stats { 
    display: flex; 
    gap: 20px; 
    justify-content: space-around; 
}
.stat-box { 
    text-align: center; 
}
.stat-num { 
    font-size: 36px; 
    font-weight: 800; 
    color: var(--primary); 
    line-height: 1; 
}
.stat-label { 
    font-size: 12px; 
    color: #64748b; 
    font-weight: 600; 
    text-transform: uppercase; 
    margin-top: 6px; 
    letter-spacing: 0.5px; 
}

@media(max-width:768px) { 
    .ecosystem-banner { 
        grid-template-columns: 1fr; 
        text-align: center; 
        padding: 30px 20px; 
        gap: 30px; 
    } 
    .eco-stats { 
        flex-wrap: wrap; 
    } 
}

/* =========================================================
   MODAL INTERACTION LAYER OVERLAYS
========================================================= */
.modal-overlay { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(15,23,42,0.6); 
    backdrop-filter: blur(4px); 
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
}
.modal-content { 
    background: white; 
    border-radius: 20px; 
    width: 100%; 
    max-width: 420px; 
    padding: 32px; 
    position: relative; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); 
    animation: modalFadeIn 0.25s ease-out forwards; 
}
@keyframes modalFadeIn { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}
.modal-close { 
    position: absolute; 
    top: 16px; 
    right: 20px; 
    font-size: 28px; 
    color: #94a3b8; 
    cursor: pointer; 
    line-height: 1; 
    transition: 0.2s; 
}
.modal-close:hover { 
    color: var(--text-main); 
}
.modal-title { 
    font-size: 24px; 
    font-weight: 800; 
    margin-bottom: 6px; 
    text-align: center; 
    color: #0f172a; 
}
.modal-subtitle { 
    text-align: center; 
    font-size: 14px; 
    color: var(--text-muted); 
    margin-bottom: 24px; 
}
.form-group { 
    margin-bottom: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}
.form-label { 
    display: block; 
    font-size: 14px; 
    font-weight: 600; 
    color: #475569; 
}
.form-input { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 15px; 
    transition: 0.2s; 
    font-family: inherit; 
    outline: none; 
    background: white; 
}
.form-input:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15); 
}
.btn-submit { 
    width: 100%; 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 14px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 16px; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 4px 10px rgba(14,165,233,0.2); 
}
.btn-submit:hover { 
    background: var(--primary-hover); 
}
.btn-submit:disabled { 
    background: #94a3b8; 
    cursor: not-allowed; 
    box-shadow: none; 
}
.error-box { 
    display: none; 
    background: #fee2e2; 
    color: #dc2626; 
    padding: 12px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    font-size: 14px; 
    text-align: center; 
    border: 1px solid #fca5a5; 
    font-weight: 600; 
}
.modal-footer { 
    text-align: center; 
    margin-top: 20px; 
    font-size: 14px; 
    color: var(--text-muted); 
}
.modal-footer a { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 600; 
}
.modal-footer a:hover { 
    text-decoration: underline; 
}

/* =========================================================
   LOADING PERFORMANCE OVERLAY SPINNERS
========================================================= */
#loading-overlay { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 60px 20px; 
    flex-grow: 1; 
}
.spinner { 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid var(--primary); 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin-bottom: 16px; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* =========================================================
   DYNAMIC FOOTER STYLES (COMPACT & FULL EDGE-TO-EDGE)
========================================================= */
.global-footer-wrapper {
    margin-top: auto; 
    padding: 14px 20px; /* Cut more than half of the padding to slash total vertical height */
    border-top: 1px solid var(--border);
    background: white;
    width: 100vw; 
    margin-left: calc(-50vw + 50%); 
    line-height: 1.2; /* Forces wrapped lines of text to nest tightly together */
}

.footer-inner-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* Minimizes the gap between the link rows and the copyright line */
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px; /* Drastically dropped row gap from 15px to 6px so wrapped lines look clean */
    font-size: 0.82rem; /* Slightly smaller text for a crisp, low-profile corporate footer */
}

.footer-nav a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap; 
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* =========================================================
   USER ACCESS CREATION MODULES (registration.html)
========================================================= */
.auth-body { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    padding: 40px 20px; 
    font-family: 'Inter', sans-serif; 
}
.auth-card { 
    background: white; 
    width: 100%; 
    max-width: 520px; 
    padding: 32px; 
    border-radius: 16px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
    margin-bottom: 24px; 
    border: 1px solid var(--border); 
}
.auth-header { 
    text-align: center; 
    margin-bottom: 24px; 
}
.auth-title { 
    font-size: 24px; 
    font-weight: 700; 
    color: #0f172a; 
    margin-bottom: 8px; 
    margin-top: 0; 
}
.auth-subtitle { 
    color: #64748b; 
    font-size: 14px; 
    margin: 0; 
}

.role-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}
.role-card { 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    padding: 10px; 
    cursor: pointer; 
    text-align: center; 
    transition: all 0.2s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: #fff; 
}
.role-card:hover { 
    border-color: #0ea5e9; 
    background-color: #f0f9ff; 
}
.role-card.selected { 
    border-color: #0ea5e9; 
    background-color: #e0f2fe; 
    color: #0284c7; 
    box-shadow: 0 0 0 1px #0ea5e9; 
}
.role-content strong { 
    display: block; 
    font-size: 0.85rem; 
    margin-bottom: 4px; 
}
.role-content span { 
    display: block; 
    font-size: 0.65rem; 
    color: #64748b; 
    line-height: 1.2; 
}

.premium-addon-card { 
    background: #fffbeb; 
    border: 2px dashed #fde68a; 
    border-radius: 12px; 
    padding: 16px; 
    margin-top: 15px; 
    transition: 0.2s; 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
    cursor: pointer; 
    user-select: none; 
}
.premium-addon-card:hover { 
    background: #fef3c7; 
    border-color: #f59e0b; 
}
.premium-addon-card input[type="checkbox"] { 
    transform: scale(1.4); 
    accent-color: #f59e0b; 
    margin-top: 3px; 
    cursor: pointer; 
}
.premium-addon-info strong { 
    display: block; 
    font-size: 14px; 
    color: #92400e; 
    margin-bottom: 2px; 
}
.premium-addon-info span { 
    display: block; 
    font-size: 11px; 
    color: #b45309; 
    line-height: 1.4; 
}

.pricing-box { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 10px; 
    padding: 20px; 
    margin: 20px 0; 
}
.pricing-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    color: #334155; 
    font-weight: 600; 
}
.total-badge { 
    background: #0ea5e9; 
    color: white; 
    padding: 6px 14px; 
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2); 
}

.service-breakdown { 
    background-color: #f0f9ff; 
    border-left: 4px solid #0ea5e9; 
    padding: 12px; 
    border-radius: 4px; 
    margin-bottom: 15px; 
    font-size: 0.8rem; 
    color: #334155; 
}
.service-breakdown strong { 
    color: #0369a1; 
    display: block; 
    margin-bottom: 4px; 
}
.service-breakdown ul { 
    margin: 5px 0 0 20px; 
    padding: 0; 
}
.service-breakdown li { 
    margin-bottom: 3px; 
    color: #475569; 
}

.btn-small-outline { 
    flex: 1; 
    padding: 10px; 
    border: 1px solid #cbd5e1; 
    background: white; 
    border-radius: 8px; 
    cursor: pointer; 
    color: #475569; 
    font-size: 0.85rem; 
    font-weight: 500; 
    transition: all 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
}
.btn-small-outline:hover { 
    border-color: #0ea5e9; 
    color: #0ea5e9; 
    background: #f0f9ff; 
}

.terms-agreement-box { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px; 
    padding: 16px; 
    margin: 24px 0 16px; 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
}
.terms-agreement-box input[type="checkbox"] { 
    transform: scale(1.3); 
    accent-color: var(--primary); 
    margin-top: 4px; 
    cursor: pointer; 
}
.terms-text { 
    font-size: 13px; 
    color: #475569; 
    line-height: 1.5; 
    margin: 0; 
}
.terms-text a { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 600; 
}
.terms-text a:hover { 
    text-decoration: underline; 
}