:root {
    /* Brand Colors */
    --primary-color: #EE3426;
    --primary-hover: #D12C1F;
    --primary-light: rgba(238, 52, 38, 0.08);

    /* Neutral Scale */
    --bg-body: #F5F7FA;
    --bg-card: #FFFFFF;
    --text-main: #1A1A1A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    --border-focus: #CBD5E1;

    /* UI Logic */
    --radius-sm: 8px;
    --radius-md: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 3rem 1.5rem;
    background-image: radial-gradient(circle at top right, rgba(238, 52, 38, 0.03), transparent 40%);
}

.container {
    width: 100%;
    max-width: 860px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
    animation: slideDown 0.6s ease-out;
}

header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.partner-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: inline-flex;
}

.partner-logo {
    height: 32px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: var(--transition);
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Forms */
.form-section {
    background-color: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius-md);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.form-section:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-focus);
}

.form-section h2 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: var(--bg-body);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:hover,
select:hover,
textarea:hover {
    background-color: #F1F5F9;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* Button */
#generateBtn,
.primary-btn {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #EE3426 0%, #B91C0F 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 20px -5px rgba(238, 52, 38, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

#generateBtn i,
.primary-btn i {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

#generateBtn:hover,
.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(238, 52, 38, 0.5);
    background: linear-gradient(135deg, #FF4538 0%, #C92518 100%);
}

#generateBtn:hover i,
.primary-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

#generateBtn:active,
.primary-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px -5px rgba(238, 52, 38, 0.4);
}

/* Results */
.hidden {
    display: none !important;
}

#resultSection {
    background-color: var(--bg-card);
    /* Outer card */
    padding: 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.6s ease-out;
}

.results-header {
    margin-bottom: 2rem;
    text-align: left;
}

.results-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
}

/* Editor Styling (Paper Look) */
#editor-wrapper {
    background-color: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    margin-bottom: 2.5rem;
    /* Quill specific overrides */
    display: flex;
    flex-direction: column;
}

/* Toolbar Config */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    background-color: #F8F9FA;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 12px !important;
}

/* Editor Area Config */
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 1rem !important;
    min-height: 400px;
    /* Tall paper feel */
}

.ql-editor {
    padding: 2rem !important;
    /* Document margins */
    line-height: 1.8;
    color: var(--text-main);
}

/* Headings inside editor */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
}

.secondary-btn {
    padding: 0.875rem 1.75rem;
    background-color: transparent;
    border: 2px solid var(--border-light);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    border-color: var(--text-main);
    background-color: var(--bg-body);
}

/* Loading */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
    margin-bottom: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.modal-header-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
    background: var(--primary-light);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-content h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.notice-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.notice-item:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

.notice-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.notice-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.notice-content p {
    font-size: 0.95rem;
    color: #000000;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

#acceptDisclaimerBtn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(238, 52, 38, 0.2);
}

#acceptDisclaimerBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(238, 52, 38, 0.3);
}

@media print {

    /* Hide everything by default */
    body * {
        visibility: hidden;
    }

    /* Only show the editor content and headers */
    #resultSection,
    #resultSection * {
        visibility: visible;
    }

    /* Position the result at the top */
    #resultSection {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    /* Hide the action buttons in the result section */
    .actions,
    .results-header {
        display: none !important;
    }

    /* Ensure text is black and readable */
    .ql-editor {
        color: black !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* Hide the main form and header */
    header,
    form,
    #loadingOverlay,
    .modal-overlay {
        display: none !important;
    }
}