body {
    direction: rtl;
    text-align: right;
    font-family: Arial, sans-serif;
    background-color: mintcream;
    margin: 0;
    padding: 0;
}

.container {
    overflow-wrap: break-word;
    width: 80%;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 4px double #4caf50;
}

.logo {
    display: block;
    margin: 0 auto 20px;
    width: 270px;
    height: auto;
}

h1, h3, h4 {
    color: #212121;
}

h1 {
    font-size: 160%;
    text-align: center;
}

h3 {
    font-size: 120%;
    margin: 20px 0 10px;
}

h4 {
    font-size: 18px;
    margin: 0 0 10px;
}

p {
    color: #424242;
}

.intro-text {
    color: #424242;
    font-size: 18px;
    text-align: center;
    margin: 20px 0;
    animation: fadeIn 1.5s ease-in-out;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-top: 10px;
    color: #333;
    font-weight: bold;
}

input, textarea, select, button {
    margin-top: 5px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#instagram {
    direction: ltr;
    text-align: right;
}

textarea {
    resize: vertical;
}

button {
    background-color: #4caf50;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    font-size: 110%;
}

button:hover {
    background-color: #81c784;
}

a {
    text-decoration: none;
}

a:hover {
    background-color: #f0f0f0;
    color: limegreen;
}

.pricing-plan {
    background-color: #fff;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    text-align: center;
}

.plan-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.plan-option {
    padding: 10px;
    text-align: center;
    border: 2px solid #4caf50;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-option:hover {
    border-color: #388e3c;
}

.plan-option:active, .plan-option:focus, .plan-option.selected {
    border-color: springgreen;
    background-color: #e8f5e9;
    outline: none;
}

.plan-option .price {
    color: limegreen;
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
}

.plan-option p {
    color: #424242;
    font-size: 14px;
    margin: 0 0 10px;
}

.animated-plan {
    animation: fadeIn 1.5s ease-in-out;
}

.error-message {
    color: #D32F2F;
    font-size: 14px;
    margin-top: 5px;
    text-align: right;
}

/* מצב תקין/שגוי לשדות טופס */
.field-valid {
    border-color: #2e7d32 !important;
    background-color: #f1fff4;
    box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle fill='%23e8f5e9' cx='12' cy='12' r='12'/%3E%3Cpath fill='%232e7d32' d='M10.1 15.2l-3-3 1.4-1.4 1.6 1.6 4.6-4.6 1.4 1.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px 50%;
    padding-left: 38px;
}

.field-invalid {
    border-color: #c62828 !important;
    background-color: #fff6f6;
    box-shadow: 0 0 0 1px rgba(198, 40, 40, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle fill='%23ffebee' cx='12' cy='12' r='12'/%3E%3Cpath fill='%23c62828' d='M8.7 8.7l6.6 6.6m0-6.6l-6.6 6.6' stroke='%23c62828' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px 50%;
    padding-left: 38px;
}

.field-valid:focus,
.field-invalid:focus {
    outline: none;
}

/* תצוגת כרטיס תצוגה מקדימה */
.preview-section {
/*    margin-top: 40px; */
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #dce775;
    background: linear-gradient(135deg, #f9fff2 0%, #f0fff4 100%);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.preview-section--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.preview-section h2 {
    margin: 0;
    font-size: 1.2em;
}

.preview-hint {
    margin: 10px 0;
    color: #4e5a51;
    font-size: 0.95em;
}

.preview-card {
    border: 1px solid #ccc;
    margin: 10px auto;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
    max-width: 800px;
    position: relative;
    box-shadow: none;
}

.preview-card.expanded {
    margin-top: 30px;
    margin-bottom: 30px;
}

.preview-card p {
    margin: 0;
}

.preview-card .professional-name {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
}

.preview-card-header {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.preview-plan-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #4caf50;
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.95em;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.25);
    margin: 0 auto 12px;
}

.preview-card .contact-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preview-card .contact-row {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 30px;
    flex-wrap: wrap;
}

.preview-card .contact-text {
    font-size: 0.9em;
    margin: 1em 0;
}

.preview-card .contact-text.extra-contact {
    margin-right: 10px;
    font-size: 0.9em;
}

.preview-contact-hint {
    font-size: 0.85em;
    color: #757575;
    margin: 0;
}

.preview-card .whatsapp-link img,
.preview-card .instagram-link img,
.preview-card .fb-link img {
    width: 30px;
    height: 30px;
}

.preview-card .website-link {
    font-size: 1em;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    margin-left: 10px;
    padding: 5px;
    border-radius: 5px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.preview-card .website-link:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}

.preview-card .contact-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.preview-media-grid {
    margin-top: 10px;
}

.preview-card .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.preview-card .image-grid[hidden],
.preview-card .expand-button[hidden],
.preview-card .close-button[hidden] {
    display: none !important;
}

.preview-card .media-item {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    object-fit: cover;
}

.preview-card .media-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.preview-card .close-button,
.preview-card .expand-button {
    position: absolute;
    width: 34px;
    height: 34px;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    padding: 0;
    margin: 0;
}

.preview-card .close-button {
    top: 12px;
    left: 12px;
    display: none;
}

.preview-card .expand-button {
    bottom: 14px;
    left: 14px;
}

.preview-card .close-button:hover,
.preview-card .expand-button:hover {
    background-color: #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.preview-card.expanded .close-button {
    display: flex;
}

.preview-card.expanded .expand-button {
    display: none;
}

/* השהייה מדורגת לשדות לפי סדר הופעה */
form > label:nth-child(1) ~ * { animation-delay: 0.1s; } /* שם */
form > label:nth-child(3) ~ * { animation-delay: 0.2s; } /* ווטסאפ */
form > label:nth-child(5) ~ * { animation-delay: 0.3s; } /* תחום העיסוק */
form > label:nth-child(7) ~ * { animation-delay: 0.4s; } /* אזור עבודה */
form > label:nth-child(9) ~ * { animation-delay: 0.5s; } /* פייסבוק */
form > label:nth-child(11) ~ * { animation-delay: 0.6s; } /* אתר */
form > label:nth-child(13) ~ * { animation-delay: 0.7s; } /* אינסטגרם */
form > label:nth-child(15) ~ * { animation-delay: 0.8s; } /* הערות */
form > div#planOptionsContainer { animation-delay: 0.9s; } /* מסלולי הצטרפות */
form > button#submitButton { animation-delay: 1.0s; } /* כפתור שליחה */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .container {
        width: 90%;
        padding: 15px;
    }

    .logo {
        width: 60%;
    }

    .plan-options {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .plan-option {
        padding: 8px;
    }

    .plan-option .price {
        font-size: 18px;
    }
    .preview-section {
        padding: 8px;
    }

}