/**
 * Zedemode V2 - Public Client Form Stylesheet
 * Premium Dark Glassmorphism Design System (RTL)
 */

:root {
    --bg-main: #0b0f19;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
    --card-bg: rgba(30, 41, 59, 0.65);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-green: #4ade80;
    --accent-blue: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #4ade80 0%, #38bdf8 100%);
    --accent-gradient-hover: linear-gradient(135deg, #22c55e 0%, #0ea5e9 100%);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: #38bdf8;
    
    --success-bg: rgba(34, 197, 94, 0.15);
    --success-border: rgba(34, 197, 94, 0.3);
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-border: rgba(239, 68, 68, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    
    --shadow-glow: 0 10px 30px -5px rgba(56, 189, 248, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    direction: rtl;
    padding: 30px 16px 60px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.6;
}

.page-wrapper {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

/* Header & Intro */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 28px;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-badge {
    display: inline-block;
    margin-bottom: 16px;
}

.logo-badge img {
    width: 234px;
    height: 134px;
    object-fit: contain;
    border-radius: 18px;
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.intro-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--text-secondary);
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out;
}

/* Info Card - shares intro-card style with extra overrides */
.info-card {
    text-align: right;
}

.info-card-headline {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.7;
    text-align: center;
    color: var(--accent-green);
}

.info-card-sub {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

.terms-trigger {
    color: var(--accent-green);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.terms-trigger:hover {
    color: var(--accent-blue);
}

/* Main Form Card */
.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .required-star {
    color: var(--accent-green);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
}

.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 18px;
    padding-left: 40px;
}

select.form-control option {
    background: #1e293b;
    color: var(--text-primary);
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

/* Form Input Prefix / Suffix */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-tag {
    position: absolute;
    left: 14px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

.input-with-icon .form-control {
    padding-left: 40px;
}

.price-hint {
    font-size: 12px;
    color: #a7f3d0;
    margin-top: 4px;
    font-weight: 500;
    min-height: 18px;
}

/* File Upload Zone */
.upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-box:hover, .upload-box.dragover {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.08);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.file-input-hidden {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.preview-thumb {
    position: relative;
    width: 100%;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Captcha & Terms */
#captcha_answer {
    flex-grow: 1;
}

/* Completely hide number input spin buttons */
#captcha_answer::-webkit-outer-spin-button,
#captcha_answer::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

#captcha_answer {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Grid/Width Adjustments:
   Clothing Size wrapper takes its own full row so the two price
   inputs fall on the next row side-by-side (50/50) */
.form-group.size-group {
    width: 100%;
    grid-column: 1 / -1;
}

.form-group.instagram-group {
    width: 100%;
    grid-column: 1 / -1;
}

.instagram-group #instagram_id {
    width: 100%;
}
.terms-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.terms-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.terms-checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-radius: var(--radius-md);
}

.captcha-question {
    direction: ltr;
    font-size: 18px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 1px;
    text-wrap: nowrap;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 18px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.submit-btn:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.5);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal Popup */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-box {
    background: #1e293b;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    padding: 30px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-body {
    font-size: 14px;
    color: var(--text-secondary);
    max-height: 520px;
    overflow-y: auto;
    padding-left: 8px;
    margin-bottom: 24px;
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-close-btn {
    width: 100%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.modal-close-btn:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(56, 189, 248, 0.5);
}

/* Textarea Character Counter */
.char-counter {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: left;
    direction: rtl;
    font-weight: 500;
    min-height: 16px;
}

/* Terms Modal Content Redesign */
.terms-method {
    margin-bottom: 24px;
}

.terms-method:last-child {
    margin-bottom: 0;
}

.terms-subtitle {
    font-size: 17px;
    font-weight: 800;
    color: var(--accent-blue);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.terms-desc {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.terms-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.terms-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.terms-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terms-card p {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.terms-card .terms-share {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    line-height: 2;
    color: var(--text-secondary);
}

.terms-share strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Highlight / Important Notes Box */
.terms-highlight {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-right: 4px solid var(--accent-green);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 14px;
}

.terms-highlight.blue-accent {
    border-color: rgba(56, 189, 248, 0.3);
    border-right-color: var(--accent-blue);
}

.terms-highlight-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-green);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terms-highlight.blue-accent .terms-highlight-title {
    color: var(--accent-blue);
}

.terms-highlight ol,
.terms-highlight ul {
    margin: 0;
    padding-right: 18px;
}

.terms-highlight li {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.terms-highlight li:last-child {
    margin-bottom: 0;
}

/* Costs List */
.terms-costs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.terms-costs li {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.terms-costs li strong {
    color: var(--accent-green);
    font-weight: 700;
    white-space: nowrap;
}

/* Form Feedback Toast / Alert */
.form-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
}

.form-alert.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-alert.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #fca5a5;
}

.form-alert.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #86efac;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive adjustments */
@media (max-width: 600px) {
    body { padding: 16px 10px 40px 10px; }
    .form-card { padding: 24px 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    .image-preview-grid { grid-template-columns: repeat(3, 1fr); }
    .logo-badge img { width: 140px; height: 80px; }
    .modal-body { max-height: 65vh; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .logo-badge img { width: 187px; height: 107px; }
}
