/* Base styles */
:root {
    --primary-color: #0f4c75;
    --secondary-color: #5bc0be;
    --text-color: #333;
    --background-color: #f6f8fa;
    --error-color: #dc3545;
    --spacing-unit: 8px;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    color: white;
    padding: clamp(40px, 8vw, 60px) 20px clamp(30px, 6vw, 40px);
    text-align: center;
}

    .hero h1 {
        font-size: clamp(24px, 5vw, 32px);
        margin-bottom: var(--spacing-unit);
        font-weight: 700;
    }

    .hero p {
        font-size: clamp(14px, 3vw, 16px);
        opacity: 0.9;
        margin-bottom: calc(var(--spacing-unit) * 3);
    }

.search-form {
    background: #fff;
    padding: clamp(20px, 4vw, 30px);
    border-radius: 12px;
    max-width: 1000px;
    margin: -20px auto 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(15px, 3vw, 20px);
}

.search-form > div {
    position: relative;
}

.search-form label {
    font-weight: 600;
    font-size: clamp(13px, 2.5vw, 14px);
    display: block;
    margin-bottom: var(--spacing-unit);
    color: var(--text-color);
}

.search-form select,
.search-form input {
    width: 100%;
    padding: clamp(10px, 2vw, 12px);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: clamp(14px, 2.5vw, 16px);
    background: white;
    height: clamp(42px, 8vw, 45px);
    transition: all 0.2s ease;
    color: var(--text-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-form select {
    padding-right: 30px; /* Space for the custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.search-form select:hover,
.search-form input:hover {
    border-color: #0f4c75;
}

.search-form select:focus,
.search-form input:focus {
    outline: none;
    border-color: #0f4c75;
    box-shadow: 0 0 0 3px rgba(15, 76, 117, 0.1);
}

/* Sort dropdown specific styles */
#sort_by {
    background-color: white;
    color: #333;
    font-weight: 500;
}

#sort_by option {
    padding: 12px;
    font-size: 14px;
    background: white;
    color: #333;
}

/* Button styles update */
.button-wrapper {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: clamp(10px, 2vw, 15px);
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.button-wrapper button,
.show-more-button {
    padding: clamp(12px, 2.5vw, 14px) clamp(30px, 6vw, 40px);
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: clamp(200px, 40vw, 220px);
    box-shadow: 0 4px 6px rgba(15, 76, 117, 0.1);
}

.clear-button {
    background: #6c757d !important;
}

.clear-button:hover {
    background: #5a6268 !important;
}

.button-wrapper button:hover,
.show-more-button:hover {
    background: #0c3d5d;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(15, 76, 117, 0.2);
}

.button-wrapper button:active,
.show-more-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(15, 76, 117, 0.1);
}

.button-wrapper button:disabled,
.show-more-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.button-wrapper button:disabled:hover,
.show-more-button:disabled:hover {
    background-color: #cccccc;
    transform: none;
    box-shadow: none;
}

/* Loading Indicator Styles */
.loading-container {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.3s ease-in;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(15, 76, 117, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

.loading-text h3 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-text p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton Loader Styles */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 30px 20px;
}

.skeleton-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in;
}

.skeleton-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 20px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 15px;
}

.skeleton-price {
    height: 24px;
    width: 40%;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 14px;
    width: 100%;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Validation styles */
.validation-error {
    color: var(--error-color);
    font-size: clamp(11px, 2vw, 12px);
    margin-top: 4px;
    display: block;
}

.validation-error.show {
    display: block;
}

.search-form input.error {
    border-color: var(--error-color);
}

/* Empty State Styles */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-in;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-8px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state h3 {
    font-size: clamp(20px, 4vw, 28px);
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state > p {
    font-size: clamp(14px, 2.5vw, 16px);
    color: #666;
    margin-bottom: 40px;
    max-width: 500px;
}

.quick-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 40px;
}

.tip-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.tip-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 15px;
}

.tip-card h4 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.tip-card p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.cta-button:active {
    transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .search-form {
        margin-top: -10px;
        border-radius: 8px;
        gap: 15px;
        padding: 20px 15px;
    }

    .search-form > div {
        width: 100%;
    }

    .search-form select,
    .search-form input {
        font-size: 16px;
        padding: 12px;
    }

    .hero {
        padding: 30px 15px 25px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .property {
        margin: 0 auto;
        max-width: 100%;
    }

    .property-details h3 {
        font-size: 16px;
    }

    .specs {
        font-size: 14px;
    }

    .button-wrapper button,
    .show-more-button {
        width: 100%;
        max-width: none;
    }

    .pagination-controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .pagination-controls button {
        min-width: 44px;
        height: 44px;
    }
}

/* Touch target optimizations */
@media (hover: none) {
    .search-form select,
    .search-form input,
    .button-wrapper button,
    .show-more-button,
    .pagination-controls button {
        min-height: 44px;
        touch-action: manipulation;
    }

    .property:hover {
        transform: none;
    }

    .property-image img:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #e0e0e0;
    }

    .search-form,
    .property {
        background: #2d2d2d;
    }

    .search-form select,
    .search-form input {
        background: #333;
        color: #e0e0e0;
        border-color: #444;
    }

    .footer {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}

.section {
    scroll-behavior: smooth;
    padding: 20px;
    flex: 1;
    min-height: calc(100vh - 400px);
}

.footer {
    background: var(--primary-color);
    color: white;
    padding: 40px 20px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.social-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

.footer-version {
    font-size: 12px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

@media (prefers-color-scheme: dark) {
    .footer {
        background: #1a1a1a;
    }

    .footer-section h3 {
        color: var(--secondary-color);
    }

    .footer-section ul li a:hover {
        color: var(--secondary-color);
    }

    .social-link:hover {
        color: var(--secondary-color);
    }
}

.button-wrapper {
    grid-column: 1 / -1;
    text-align: center;
}

    .footer strong {
        color: #0f4c75;
    }

    .section h2 {
        font-size: 1.75rem;
        font-weight: 600;
        color: var(--primary-color);
        margin: 2rem 0 1.5rem;
        padding: 0 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
    }

    .section h2::after {
        content: '';
        display: block;
        width: 50px;
        height: 3px;
        background: var(--secondary-color);
        margin-left: 1rem;
        border-radius: 2px;
    }

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(16px, 3vw, 24px);
    padding: clamp(15px, 3vw, 20px);
}

.property {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.property:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.property-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
}

.property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property:hover .property-image img {
    transform: scale(1.05);
}

.property-details {
    padding: clamp(15px, 3vw, 20px);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vw, 12px);
}

.price {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 700;
    color: var(--primary-color);
}

.property-details h3 {
    font-size: 16px;
    margin: 0;
    color: #333;
    line-height: 1.4;
}

.specs {
    font-size: 14px;
    color: #666;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    display: inline-block;
}

.description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.source-badge {
    font-size: 12px;
    color: #888;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.view-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0f4c75;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.2s;
    margin-top: auto;
}

.view-button:hover {
    background: #0c3d5d;
    text-decoration: none;
}

/* Total results count */
.total-results {
    padding: 20px;
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

/* Pagination styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
}

.pagination-controls button {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: #0f4c75;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    box-shadow: 0 4px 6px rgba(15, 76, 117, 0.1);
}

.pagination-controls button:hover:not([disabled]) {
    background: #0c3d5d;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(15, 76, 117, 0.2);
}

.pagination-controls button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(15, 76, 117, 0.1);
}

.pagination-controls button[disabled] {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-controls span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .pagination-controls button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .pagination-controls span {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .property-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 20px;
    }

    .property {
        max-width: 100%;
        margin: 0;
    }

    .property-image {
        height: 200px;
    }

    .property-details {
        padding: 15px;
    }

    .price {
        font-size: 20px;
    }
}

#searchButton:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#searchButton:disabled:hover {
    background-color: #cccccc;
}

.search-form.searching select,
.search-form.searching input {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.search-form.searching select:hover,
.search-form.searching input:hover {
    border-color: #e0e0e0;
}

.search-form.searching select:focus,
.search-form.searching input:focus {
    border-color: #e0e0e0;
    box-shadow: none;
}

.error-message {
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #d32f2f;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-10px);
    animation: slideIn 0.3s ease-out forwards;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message h3 {
    margin: 0 0 8px 0;
    color: #d32f2f;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message h3::before {
    content: "⚠️";
    font-size: 16px;
}

.error-message p {
    margin: 5px 0;
    font-size: 13px;
}

.error-help {
    color: #666;
    font-size: 12px;
    margin-top: 6px;
    font-style: italic;
    opacity: 0.9;
    padding-left: 2px;
}

#location-error {
    margin-top: 5px;
    margin-bottom: 10px;
    min-height: 30px;
    transition: all 0.3s ease-in-out;
}

#location-error .error-message {
    margin: 0;
    border-left: 3px solid #d32f2f;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .error-message {
        background-color: rgba(211, 47, 47, 0.1);
        border-color: rgba(255, 107, 107, 0.3);
        color: #ff6b6b;
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
    }

    .error-message h3 {
        color: #ff6b6b;
    }

    .error-help {
        color: #aaa;
    }

    #location-error .error-message {
        border-left-color: #ff6b6b;
    }

    .section h2 {
        color: var(--secondary-color);
    }
    
    .section h2::after {
        background: var(--primary-color);
    }
}

.results-header {
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 100;
    padding: 0.75rem 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-header.scrolled {
    background: rgba(246, 248, 250, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-header h2 {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

#results-count {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 500;
    transition: all 0.3s ease;
}

.results-section {
    padding: 1rem 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .results-header {
        padding: 0.5rem 0.75rem;
    }

    .results-header h2 {
        font-size: 1.25rem;
    }

    #results-count {
        font-size: 0.9rem;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state-icon {
        font-size: 60px;
    }

    .quick-tips {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tip-card {
        padding: 20px 15px;
    }

    .cta-button {
        width: 100%;
        padding: 14px 30px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .results-header {
        background: var(--background-color);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .results-header.scrolled {
        background: rgba(20, 20, 20, 0.95);
    }

    .results-header h2 {
        color: var(--secondary-color);
    }
}

/* Legal Modal Override */
.email-modal-content.legal-modal {
    max-width: 900px !important;
    max-height: 85vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    margin: 5vh auto !important;
}

.email-modal-content.legal-modal .email-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    z-index: 10;
}

.email-modal-content.legal-modal h2 {
    margin: 0;
    padding: 25px 45px 20px;
    color: var(--primary-color);
    font-size: 28px;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.email-modal-content.legal-modal .legal-content {
    overflow-y: auto;
    padding: 25px 45px 35px;
    flex: 1;
}

@media (max-width: 768px) {
    .email-modal-content.legal-modal {
        max-height: 90vh;
        width: 95%;
        margin: 3vh auto !important;
    }

    .email-modal-content.legal-modal h2 {
        font-size: 22px;
        padding: 20px 20px 15px;
    }

    .email-modal-content.legal-modal .legal-content {
        padding: 20px;
    }

    .email-modal-content.legal-modal .email-modal-close {
        top: 15px;
        right: 15px;
    }

    .legal-content h3 {
        font-size: 18px;
    }
}

@media (max-width: 400px) {
    .email-modal-content.legal-modal {
        width: 98%;
    }

    .email-modal-content.legal-modal h2 {
        font-size: 20px;
        padding: 18px 15px 12px;
    }

    .email-modal-content.legal-modal .legal-content {
        padding: 15px;
    }
}