/* =========================================================================
   ACADEMIC MASTER - FREE ONLINE WRITING TOOLS HUB STYLESHEET
   Description: Premium, high-converting design inspired by PapersOwl aesthetics.
   Fonts: Inter (Body), Outfit (Headings)
   Colors: Oceanic Blue (#0D6493), Deep Navy (#043353), Vibrant Orange (#FF7A00)
========================================================================= */

:root {
    --am-ocean-blue: #0D6493;
    --am-navy-dark: #043353;
    --am-orange-action: #FF7A00;
    --am-orange-hover: #E06900;
    --am-light-bg: #F8FAFC;
    --am-border-color: #E2E8F0;
    --am-text-main: #0F172A;
    --am-text-muted: #64748B;
    --am-circle-bg: #E1F2FE;
    --am-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --am-card-shadow-hover: 0 12px 20px -4px rgba(13, 100, 147, 0.15), 0 4px 8px -2px rgba(13, 100, 147, 0.1);
}

/* Base Reset & Container */
.am-tools-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--am-text-main);
    background-color: #FFFFFF;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.am-tools-wrapper * {
    box-sizing: border-box;
}

/* =========================================================================
   1. HERO SECTION
========================================================================= */
.am-tools-hero {
    background-color: var(--am-ocean-blue);
    background-image: linear-gradient(135deg, #0A5C8A 0%, #0D6493 100%);
    color: #FFFFFF;
    padding: 70px 24px 80px 24px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.am-hero-inner {
    max-width: 1040px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.am-tools-hero h1 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 24px 0;
    max-width: 800px;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    text-transform: uppercase;
}

.am-tools-hero p {
    font-size: 19px;
    line-height: 1.6;
    margin: 0;
    max-width: 740px;
    color: #E1F2FE;
    font-weight: 400;
}

/* =========================================================================
   2. TOOLS GRID SECTION
========================================================================= */
.am-tools-main {
    max-width: 1040px;
    margin: 60px auto 80px auto;
    padding: 0 24px;
}

.am-section-title {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: var(--am-navy-dark);
    margin: 0 0 50px 0;
    letter-spacing: -0.3px;
}

.am-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.am-tool-card {
    background-color: #FFFFFF;
    border: 1px solid var(--am-border-color);
    border-radius: 12px;
    padding: 36px 24px 30px 24px;
    text-align: center;
    box-shadow: var(--am-card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.am-tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--am-card-shadow-hover);
    border-color: #BAD8EB;
}

.am-tool-icon-circle {
    width: 96px;
    height: 96px;
    background-color: var(--am-circle-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    transition: transform 0.3s ease;
}

.am-tool-card:hover .am-tool-icon-circle {
    transform: scale(1.05);
}

.am-tool-icon-circle svg {
    width: 48px;
    height: 48px;
    color: var(--am-ocean-blue);
}

.am-tool-title {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--am-text-main);
    margin: 0 0 14px 0;
    line-height: 1.3;
}

.am-tool-desc {
    font-size: 14px;
    color: var(--am-text-muted);
    line-height: 1.6;
    margin: 0 0 28px 0;
    flex-grow: 1;
}

/* Tool Buttons */
.am-btn-tool {
    width: 100%;
    display: inline-block;
    background-color: #FFFFFF;
    color: var(--am-ocean-blue);
    border: 2px solid var(--am-ocean-blue);
    border-radius: 6px;
    padding: 12px 20px;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.am-btn-tool:hover {
    background-color: var(--am-ocean-blue);
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(13, 100, 147, 0.2);
}

/* =========================================================================
   3. PROMOTIONAL SERVICE BANNERS (MID-PAGE)
========================================================================= */
.am-promo-container {
    max-width: 1040px;
    margin: 0 auto 80px auto;
    padding: 0 24px;
}

.am-banner-dark {
    background-color: var(--am-navy-dark);
    color: #FFFFFF;
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(4, 51, 83, 0.15);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.am-banner-dark h3 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.am-banner-dark p {
    font-size: 17px;
    color: #CFE4F3;
    margin: 0 0 24px 0;
}

.am-doc-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.am-doc-pill {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
}

/* Light Action Banner */
.am-banner-light {
    background-color: var(--am-circle-bg);
    border: 1px solid #BAD8EB;
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
}

.am-action-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
    margin: 0 0 32px 0;
}

.am-action-item {
    font-size: 17px;
    font-weight: 600;
    color: var(--am-navy-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-action-item svg {
    width: 22px;
    height: 22px;
    color: var(--am-orange-action);
}

.am-btn-orange {
    display: inline-block;
    background-color: var(--am-orange-action);
    color: #FFFFFF;
    padding: 16px 36px;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.am-btn-orange:hover {
    background-color: var(--am-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 122, 0, 0.4);
    color: #FFFFFF;
}

/* =========================================================================
   4. LEAD CAPTURE / ORDER WIDGET
========================================================================= */
.am-lead-widget {
    background-color: var(--am-ocean-blue);
    background-image: linear-gradient(135deg, #0D6493 0%, #043353 100%);
    border-radius: 16px;
    padding: 48px 56px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    color: #FFFFFF;
    box-shadow: 0 15px 30px rgba(4, 51, 83, 0.2);
    margin-top: 50px;
}

.am-lead-info {
    max-width: 440px;
}

.am-lead-info h3 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 14px 0;
    line-height: 1.2;
    color: #FFFFFF;
    text-transform: uppercase;
}

.am-lead-info p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    color: #CFE4F3;
}

.am-lead-form {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 540px;
}

.am-form-input-wrapper {
    flex-grow: 1;
}

.am-select-service,
.am-input-email {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 15px;
    color: #FFFFFF;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.am-select-service {
    margin-bottom: 12px;
    cursor: pointer;
}

.am-select-service option {
    background-color: var(--am-navy-dark);
    color: #FFFFFF;
}

.am-select-service:focus,
.am-input-email:focus {
    border-color: var(--am-orange-action);
    background-color: rgba(255, 255, 255, 0.2);
}

.am-input-email::placeholder {
    color: #CFE4F3;
    opacity: 0.7;
}

.am-form-btn-wrapper {
    display: flex;
    align-items: stretch;
}

.am-btn-proceed {
    background-color: var(--am-orange-action);
    color: #FFFFFF;
    padding: 0 32px;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
    transition: all 0.2s ease;
    height: 106px; /* Matches the combined height of the two inputs */
    display: flex;
    align-items: center;
    justify-content: center;
}

.am-btn-proceed:hover {
    background-color: var(--am-orange-hover);
    box-shadow: 0 6px 16px rgba(255, 122, 0, 0.4);
}

/* =========================================================================
   5. GLASSMORPHISM POPUP MODAL (TOOL INTERACTION)
========================================================================= */
.am-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.am-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.am-modal-box {
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    margin: 20px;
    padding: 40px 48px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
    text-align: center;
}

.am-modal-backdrop.active .am-modal-box {
    transform: scale(1);
}

.am-btn-modal-close {
    position: absolute;
    top: 22px;
    right: 22px;
    background: #F1F5F9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--am-text-muted);
    transition: all 0.2s ease;
}

.am-btn-modal-close:hover {
    background: #E2E8F0;
    color: var(--am-text-main);
}

.am-modal-box h2 {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--am-navy-dark);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.am-modal-box p {
    font-size: 15px;
    color: var(--am-text-muted);
    line-height: 1.6;
    margin: 0 0 28px 0;
}

.am-modal-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.am-modal-input {
    width: 100%;
    border: 1px solid var(--am-border-color);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 15px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.am-modal-input:focus {
    border-color: var(--am-ocean-blue);
    box-shadow: 0 0 0 3px rgba(13, 100, 147, 0.15);
}

.am-modal-textarea {
    min-height: 120px;
    resize: vertical;
}

.am-btn-modal-submit {
    width: 100%;
    padding: 16px;
    background-color: var(--am-orange-action);
    color: #FFFFFF;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
    transition: all 0.2s ease;
}

.am-btn-modal-submit:hover {
    background-color: var(--am-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 122, 0, 0.4);
}

/* Modal Error & Results Styling */
.am-modal-error {
    background-color: #FEF2F2;
    border: 1px solid #F87171;
    color: #991B1B;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.am-modal-error.hidden,
.am-modal-results.hidden {
    display: none;
}

.am-modal-results {
    text-align: left;
    margin-top: 24px;
    border-top: 2px solid var(--am-border-color);
    padding-top: 24px;
}

.am-results-content {
    background-color: var(--am-light-bg);
    border: 1px solid var(--am-border-color);
    border-radius: 8px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--am-text-main);
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.am-btn-modal-copy {
    width: 100%;
    padding: 14px;
    background-color: var(--am-ocean-blue);
    color: #FFFFFF;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(13, 100, 147, 0.2);
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.am-btn-modal-copy:hover {
    background-color: var(--am-navy-dark);
    transform: translateY(-2px);
}

.am-results-cta {
    background-color: #FFF7ED;
    border: 1px solid #FFEDD5;
    padding: 14px 18px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #9A3412;
}

.am-results-cta a {
    color: var(--am-orange-action);
    font-weight: 700;
    text-decoration: none;
}

.am-results-cta a:hover {
    text-decoration: underline;
}

/* =========================================================================
   6. RESPONSIVE MEDIA QUERIES
========================================================================= */
@media (max-width: 992px) {
    .am-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .am-lead-widget {
        flex-direction: column;
        text-align: center;
        padding: 40px 32px;
        gap: 30px;
    }
    .am-lead-info {
        max-width: 100%;
    }
    .am-lead-form {
        flex-direction: column;
        max-width: 100%;
    }
    .am-form-input-wrapper,
    .am-form-btn-wrapper,
    .am-btn-proceed {
        width: 100%;
    }
    .am-btn-proceed {
        height: 54px;
        padding: 14px;
    }
}

@media (max-width: 768px) {
    .am-tools-hero {
        padding: 50px 20px 60px 20px;
    }
    .am-tools-hero h1 {
        font-size: 32px;
    }
    .am-tools-hero p {
        font-size: 16px;
    }
    .am-tools-grid {
        grid-template-columns: 1fr;
    }
    .am-banner-dark,
    .am-banner-light {
        padding: 32px 24px;
    }
    .am-action-list {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    .am-modal-box {
        padding: 32px 24px;
    }
}
