/* YAZ Model Registration - Public Form Styles */

:root {
    --yaz-primary: #4a1a8a;
    --yaz-primary-light: #6b3fa0;
    --yaz-primary-lighter: #f0e6ff;
    --yaz-primary-dark: #3a1070;
    --yaz-success: #28a745;
    --yaz-danger: #dc3545;
    --yaz-warning: #ffc107;
    --yaz-border: #e2e8f0;
    --yaz-bg: #f8f9fa;
    --yaz-text: #333;
    --yaz-text-light: #666;
    --yaz-radius: 8px;
    --yaz-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Form Wrapper */
.yaz-mr-form-wrapper {
    max-width: 900px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.yaz-mr-form-header {
    background: linear-gradient(135deg, var(--yaz-primary) 0%, var(--yaz-primary-light) 50%, var(--yaz-primary) 100%);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.yaz-mr-form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    transform: rotate(-15deg);
}

.yaz-mr-form-logo {
    position: relative;
    z-index: 1;
}

.yaz-mr-form-title {
    position: relative;
    z-index: 1;
}

.yaz-mr-form-title h2 {
    color: #fff;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.yaz-mr-form-title p {
    color: rgba(255,255,255,0.8);
    margin: 3px 0 0;
    font-size: 14px;
}

/* Form */
.yaz-mr-form {
    padding: 25px 30px;
}

/* Section */
.yaz-mr-form-section {
    margin-bottom: 25px;
}

.yaz-mr-section-title {
    background: var(--yaz-primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--yaz-radius);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yaz-mr-section-title-ar {
    font-weight: 700;
    font-size: 15px;
}

.yaz-mr-section-title-en {
    font-size: 12px;
    opacity: 0.8;
}

/* Fields Row */
.yaz-mr-fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Field Groups */
.yaz-mr-field-group {
    margin-bottom: 5px;
}

.yaz-mr-field-full {
    width: 100%;
}

.yaz-mr-field-half {
    width: calc(50% - 8px);
}

.yaz-mr-field-third {
    width: calc(33.333% - 10px);
}

/* Labels */
.yaz-mr-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--yaz-text);
    font-size: 14px;
}

.yaz-mr-label-en {
    display: block;
    font-weight: normal;
    color: var(--yaz-text-light);
    font-size: 11px;
}

.yaz-mr-required {
    color: var(--yaz-danger);
    margin-right: 2px;
}

/* Inputs */
.yaz-mr-input,
.yaz-mr-textarea,
.yaz-mr-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--yaz-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
    color: var(--yaz-text);
    box-sizing: border-box;
}

.yaz-mr-input:focus,
.yaz-mr-textarea:focus,
.yaz-mr-select:focus {
    border-color: var(--yaz-primary);
    box-shadow: 0 0 0 3px rgba(74, 26, 138, 0.1);
    outline: none;
}

.yaz-mr-input.error,
.yaz-mr-textarea.error,
.yaz-mr-select.error {
    border-color: var(--yaz-danger);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.yaz-mr-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Tel Wrapper */
.yaz-mr-tel-wrapper {
    display: flex;
    gap: 8px;
}

.yaz-mr-tel-input {
    flex: 1;
}

.yaz-mr-sms-btn {
    padding: 10px 18px;
    background: var(--yaz-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.3s;
    font-family: inherit;
}

.yaz-mr-sms-btn:hover {
    background: var(--yaz-primary-dark);
}

.yaz-mr-sms-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.yaz-mr-sms-btn.sent {
    background: var(--yaz-success);
}

/* SMS Verification */
.yaz-mr-sms-verify {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: var(--yaz-primary-lighter);
    border-radius: 6px;
}

.yaz-mr-sms-code-input {
    width: 150px !important;
    text-align: center;
    font-size: 18px !important;
    letter-spacing: 5px;
    font-weight: bold;
}

.yaz-mr-verify-btn {
    padding: 10px 20px;
    background: var(--yaz-success);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.3s;
    font-family: inherit;
}

.yaz-mr-verify-btn:hover {
    background: #218838;
}

.yaz-mr-sms-status {
    font-size: 13px;
    font-weight: 600;
}

.yaz-mr-sms-status.success {
    color: var(--yaz-success);
}

.yaz-mr-sms-status.error {
    color: var(--yaz-danger);
}

.yaz-mr-sms-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d4edda;
    color: var(--yaz-success);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Radio & Checkbox Groups */
.yaz-mr-radio-group,
.yaz-mr-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.yaz-mr-radio-label,
.yaz-mr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--yaz-bg);
    border: 2px solid var(--yaz-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    user-select: none;
}

.yaz-mr-radio-label:hover,
.yaz-mr-checkbox-label:hover {
    border-color: var(--yaz-primary);
    background: var(--yaz-primary-lighter);
}

.yaz-mr-radio:checked + .yaz-mr-radio-custom + *,
.yaz-mr-checkbox:checked + .yaz-mr-checkbox-custom + * {
    color: var(--yaz-primary);
    font-weight: 600;
}

.yaz-mr-radio-label:has(input:checked),
.yaz-mr-checkbox-label:has(input:checked) {
    border-color: var(--yaz-primary);
    background: var(--yaz-primary-lighter);
}

/* Custom Radio */
.yaz-mr-radio {
    display: none;
}

.yaz-mr-radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--yaz-border);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.yaz-mr-radio:checked + .yaz-mr-radio-custom {
    border-color: var(--yaz-primary);
}

.yaz-mr-radio:checked + .yaz-mr-radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--yaz-primary);
    border-radius: 50%;
}

/* Custom Checkbox */
.yaz-mr-checkbox {
    display: none;
}

.yaz-mr-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--yaz-border);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.yaz-mr-checkbox:checked + .yaz-mr-checkbox-custom {
    background: var(--yaz-primary);
    border-color: var(--yaz-primary);
}

.yaz-mr-checkbox:checked + .yaz-mr-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 2px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Checkbox Single (Acknowledgment) */
.yaz-mr-checkbox-single {
    padding: 15px;
    background: var(--yaz-primary-lighter);
    border-radius: 6px;
    border: 2px solid var(--yaz-border);
}

.yaz-mr-checkbox-single .yaz-mr-checkbox-label {
    background: transparent;
    border: none;
    padding: 0;
    align-items: flex-start;
}

.yaz-mr-checkbox-text {
    line-height: 1.6;
    font-size: 13px;
}

/* File Input */
.yaz-mr-file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--yaz-border);
    border-radius: 6px;
    background: var(--yaz-bg);
    cursor: pointer;
    font-size: 14px;
}

.yaz-mr-file-input:hover {
    border-color: var(--yaz-primary);
}

/* Field Error */
.yaz-mr-field-error {
    color: var(--yaz-danger);
    font-size: 12px;
    margin-top: 4px;
    min-height: 0;
}

/* Submit Button */
.yaz-mr-form-submit {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--yaz-border);
}

.yaz-mr-submit-btn {
    display: inline-block;
    padding: 14px 60px;
    background: linear-gradient(135deg, var(--yaz-primary) 0%, var(--yaz-primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(74, 26, 138, 0.3);
    font-family: inherit;
}

.yaz-mr-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 26, 138, 0.4);
}

.yaz-mr-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.yaz-mr-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: yaz-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

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

/* Success Message */
.yaz-mr-success-message {
    text-align: center;
    padding: 50px 30px;
}

.yaz-mr-success-icon {
    width: 80px;
    height: 80px;
    background: var(--yaz-success);
    color: #fff;
    font-size: 40px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: yaz-bounce 0.5s ease;
}

@keyframes yaz-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.yaz-mr-success-message h3 {
    color: var(--yaz-success);
    font-size: 24px;
    margin-bottom: 10px;
}

.yaz-mr-success-message p {
    color: var(--yaz-text-light);
    font-size: 16px;
}

/* Footer */
.yaz-mr-form-footer {
    background: var(--yaz-primary);
    padding: 15px 30px;
    text-align: center;
}

.yaz-mr-footer-info {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.yaz-mr-footer-info span {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .yaz-mr-form-wrapper {
        margin: 15px;
        border-radius: 8px;
    }

    .yaz-mr-form-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .yaz-mr-form {
        padding: 15px;
    }

    .yaz-mr-field-half,
    .yaz-mr-field-third {
        width: 100%;
    }

    .yaz-mr-tel-wrapper {
        flex-direction: column;
    }

    .yaz-mr-sms-verify {
        flex-direction: column;
    }

    .yaz-mr-radio-group,
    .yaz-mr-checkbox-group {
        flex-direction: column;
    }

    .yaz-mr-submit-btn {
        width: 100%;
        padding: 14px 20px;
    }

    .yaz-mr-footer-info {
        flex-direction: column;
        gap: 8px;
    }

    .yaz-mr-section-title {
        flex-direction: column;
        text-align: center;
        gap: 3px;
    }
}

@media screen and (max-width: 480px) {
    .yaz-mr-form-title h2 {
        font-size: 18px;
    }

    .yaz-mr-radio-label,
    .yaz-mr-checkbox-label {
        font-size: 12px;
        padding: 6px 10px;
    }
}
