/* ============================================
   DEVA Membership Form - Modern Multi-Step UI
   ============================================ */

:root {
    --mf-primary: #1580dc;
    --mf-primary-dark: #0e5a9e;
    --mf-primary-light: #e0f2fe;
    --mf-accent: #dc1515;
    --mf-accent-light: #fee2e2;
    --mf-success: #10b981;
    --mf-success-light: #d1fae5;
    --mf-warning: #f59e0b;
    --mf-warning-light: #fef3c7;
    --mf-error: #ef4444;
    --mf-error-light: #fee2e2;
    --mf-text: #1e293b;
    --mf-text-muted: #64748b;
    --mf-text-light: #94a3b8;
    --mf-border: #e2e8f0;
    --mf-bg: #ffffff;
    --mf-bg-soft: #f8fafc;
    --mf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --mf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --mf-radius: 12px;
    --mf-radius-lg: 20px;
    --mf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Container */
.membership-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--mf-bg-soft) 0%, var(--mf-bg) 100%);
}

.membership-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Hero Section */
.membership-hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 32px;
}

.membership-hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--mf-primary) 0%, var(--mf-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(21, 128, 220, 0.3);
}

.membership-hero-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.membership-hero h1 {
    font-family: var(--red-hat-display), system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--mf-text);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.membership-hero p {
    font-size: 1.1rem;
    color: var(--mf-text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--mf-border);
    color: var(--mf-text-muted);
    transition: var(--mf-transition);
    flex-shrink: 0;
}

.progress-step-label {
    font-size: 0.875rem;
    color: var(--mf-text-muted);
    font-weight: 500;
    display: none;
}

@media (min-width: 768px) {
    .progress-step-label {
        display: block;
    }
}

.progress-step.active .progress-step-number {
    background: var(--mf-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(21, 128, 220, 0.4);
}

.progress-step.active .progress-step-label {
    color: var(--mf-primary);
}

.progress-step.completed .progress-step-number {
    background: var(--mf-success);
    color: white;
}

.progress-step.completed .progress-step-label {
    color: var(--mf-success);
}

.progress-step-line {
    width: 30px;
    height: 3px;
    background: var(--mf-border);
    border-radius: 2px;
    transition: var(--mf-transition);
}

.progress-step.completed + .progress-step-line,
.progress-step.completed ~ .progress-step-line {
    background: var(--mf-success);
}

@media (max-width: 767px) {
    .progress-step-line {
        width: 20px;
    }
}

/* Form Card */
.mf-card {
    background: var(--mf-bg);
    border-radius: var(--mf-radius-lg);
    box-shadow: var(--mf-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.mf-card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--mf-border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.mf-card-icon {
    width: 48px;
    height: 48px;
    background: var(--mf-primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mf-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--mf-primary);
}

.mf-card-icon.accent {
    background: var(--mf-accent-light);
}

.mf-card-icon.accent svg {
    color: var(--mf-accent);
}

.mf-card-header-text h2 {
    font-family: var(--red-hat-display), system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mf-text);
    margin: 0 0 4px;
}

.mf-card-header-text p {
    font-size: 0.9rem;
    color: var(--mf-text-muted);
    margin: 0;
}

.mf-card-body {
    padding: 32px;
}

/* Step Sections */
.mf-step {
    display: none;
}

.mf-step.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* Phone Verification Step */
.phone-step-content {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.phone-step-content p {
    color: var(--mf-text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.phone-step-content p strong {
    color: var(--mf-text);
}

.phone-input-container {
    margin-bottom: 16px;
}

.phone-input-container .iti {
    width: 100%;
}

.phone-input-container input {
    width: 100%;
    height: 56px;
    padding: 0 16px 0 90px;
    font-size: 1.1rem;
    border: 2px solid var(--mf-border);
    border-radius: var(--mf-radius);
    transition: var(--mf-transition);
    background: var(--mf-bg);
}

.phone-input-container input:focus {
    outline: none;
    border-color: var(--mf-primary);
    box-shadow: 0 0 0 4px var(--mf-primary-light);
}

.phone-input-container input.error {
    border-color: var(--mf-error);
    box-shadow: 0 0 0 4px var(--mf-error-light);
}

.phone-input-container input.valid {
    border-color: var(--mf-success);
    box-shadow: 0 0 0 4px var(--mf-success-light);
}

.phone-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 28px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.phone-status.valid {
    color: var(--mf-success);
}

.phone-status.error {
    color: var(--mf-error);
}

.phone-status svg {
    width: 18px;
    height: 18px;
}

/* Form Grid */
.mf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.mf-grid.single {
    grid-template-columns: 1fr;
}

@media (max-width: 640px) {
    .mf-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Group */
.mf-group {
    position: relative;
}

.mf-group.full-width {
    grid-column: 1 / -1;
}

.mf-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mf-text);
    margin-bottom: 8px;
}

.mf-label .required {
    color: var(--mf-error);
    margin-left: 2px;
}

.mf-input,
.mf-select,
.mf-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--mf-text);
    background: var(--mf-bg);
    border: 2px solid var(--mf-border);
    border-radius: var(--mf-radius);
    transition: var(--mf-transition);
    -webkit-appearance: none;
    appearance: none;
}

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

.mf-input::placeholder,
.mf-textarea::placeholder {
    color: var(--mf-text-light);
}

.mf-select {
    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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
    cursor: pointer;
}

.mf-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* Validation States */
.mf-input.error,
.mf-select.error,
.mf-textarea.error {
    border-color: var(--mf-error);
    box-shadow: 0 0 0 4px var(--mf-error-light);
}

.mf-input.valid,
.mf-select.valid,
.mf-textarea.valid {
    border-color: var(--mf-success);
    box-shadow: 0 0 0 4px var(--mf-success-light);
}

.mf-input.valid:focus,
.mf-select.valid:focus {
    border-color: var(--mf-success);
    box-shadow: 0 0 0 4px var(--mf-success-light);
}

.mf-error-text {
    display: none;
    font-size: 0.8rem;
    color: var(--mf-error);
    margin-top: 6px;
    align-items: center;
    gap: 4px;
}

.mf-error-text svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.mf-group.has-error .mf-error-text {
    display: flex;
}

.mf-hint {
    font-size: 0.8rem;
    color: var(--mf-text-muted);
    margin-top: 6px;
    transition: color 0.2s ease;
}

.mf-hint.success {
    color: var(--mf-success);
}

.mf-hint.warning {
    color: var(--mf-warning);
}

.mf-hint.error {
    color: var(--mf-error);
}

/* Photo Upload */
.photo-upload-wrapper {
    text-align: center;
}

.photo-upload-notice {
    background: var(--mf-warning-light);
    padding: 16px 20px;
    border-radius: var(--mf-radius);
    margin-bottom: 24px;
    text-align: left;
}

.photo-upload-notice p {
    font-size: 0.9rem;
    color: #92400e;
    margin: 0;
    line-height: 1.5;
}

.photo-upload-notice strong {
    display: block;
    margin-bottom: 4px;
}

.photo-upload-area {
    border: 2px dashed var(--mf-border);
    border-radius: var(--mf-radius);
    padding: 40px 20px;
    cursor: pointer;
    transition: var(--mf-transition);
    margin-bottom: 20px;
}

.photo-upload-area:hover {
    border-color: var(--mf-primary);
    background: var(--mf-primary-light);
}

.photo-upload-area.has-error {
    border-color: var(--mf-error);
    background: var(--mf-error-light);
}

.photo-upload-area input[type="file"] {
    display: none;
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.photo-upload-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--mf-text-light);
}

.photo-upload-placeholder span {
    font-size: 1rem;
    color: var(--mf-text-muted);
}

.photo-preview-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.photo-preview-container.visible {
    display: flex;
}

.photo-preview {
    width: 200px;
    height: 200px;
    border-radius: var(--mf-radius);
    overflow: hidden;
    border: 3px solid var(--mf-border);
    background: var(--mf-bg-soft);
}

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

.photo-crop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--mf-primary);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--mf-radius);
    cursor: pointer;
    transition: var(--mf-transition);
}

.photo-crop-btn:hover {
    background: var(--mf-primary-dark);
}

.photo-change-btn {
    background: transparent;
    color: var(--mf-primary);
    border: 2px solid var(--mf-primary);
    padding: 10px 20px;
    font-size: 0.85rem;
}

.photo-change-btn:hover {
    background: var(--mf-primary);
    color: white;
}

/* Checkbox Group */
.mf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mf-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    background: var(--mf-bg-soft);
    border-radius: var(--mf-radius);
    border: 2px solid transparent;
    transition: var(--mf-transition);
}

.mf-checkbox:hover {
    background: var(--mf-primary-light);
}

.mf-checkbox.checked {
    border-color: var(--mf-primary);
    background: var(--mf-primary-light);
}

.mf-checkbox input {
    width: 22px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--mf-primary);
    cursor: pointer;
}

.mf-checkbox-label {
    font-size: 0.95rem;
    color: var(--mf-text);
    line-height: 1.5;
    user-select: none;
}

.mf-checkbox-label a {
    color: var(--mf-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Agreements Info Card */
.agreements-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--mf-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.agreements-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mf-text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agreements-info h4 svg {
    width: 20px;
    height: 20px;
    color: var(--mf-primary);
}

.agreements-info ul {
    margin: 0;
    padding-left: 20px;
}

.agreements-info li {
    font-size: 0.9rem;
    color: var(--mf-text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.agreements-info li:last-child {
    margin-bottom: 0;
}

/* Buttons */
.mf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--mf-radius);
    cursor: pointer;
    transition: var(--mf-transition);
    text-decoration: none;
}

.mf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mf-btn-primary {
    background: linear-gradient(135deg, var(--mf-primary) 0%, var(--mf-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(21, 128, 220, 0.4);
}

.mf-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 128, 220, 0.5);
}

.mf-btn-accent {
    background: linear-gradient(135deg, var(--mf-accent) 0%, #b91c1c 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(220, 21, 21, 0.4);
}

.mf-btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 21, 21, 0.5);
}

.mf-btn-outline {
    background: transparent;
    color: var(--mf-text-muted);
    border: 2px solid var(--mf-border);
}

.mf-btn-outline:hover:not(:disabled) {
    border-color: var(--mf-text-muted);
    color: var(--mf-text);
}

.mf-btn-large {
    padding: 18px 48px;
    font-size: 1.1rem;
}

.mf-btn-block {
    width: 100%;
}

.mf-btn .spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Button Group */
.mf-btn-group {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--mf-border);
}

@media (max-width: 480px) {
    .mf-btn-group {
        flex-direction: column-reverse;
    }
    
    .mf-btn-group .mf-btn {
        width: 100%;
    }
}

/* OTP Modal */
.otp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.otp-modal-overlay.visible {
    display: flex;
}

.otp-modal {
    background: var(--mf-bg);
    border-radius: var(--mf-radius-lg);
    max-width: 400px;
    width: 100%;
    padding: 32px;
    text-align: center;
    box-shadow: var(--mf-shadow-lg);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.otp-modal h3 {
    font-family: var(--red-hat-display), system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mf-text);
    margin: 0 0 12px;
}

.otp-modal p {
    font-size: 0.95rem;
    color: var(--mf-text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}

.otp-input {
    width: 100%;
    height: 60px;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 12px;
    border: 2px solid var(--mf-border);
    border-radius: var(--mf-radius);
    margin-bottom: 16px;
    transition: var(--mf-transition);
}

.otp-input:focus {
    outline: none;
    border-color: var(--mf-primary);
    box-shadow: 0 0 0 4px var(--mf-primary-light);
}

.otp-input.error {
    border-color: var(--mf-error);
    box-shadow: 0 0 0 4px var(--mf-error-light);
}

.otp-error {
    color: var(--mf-error);
    font-size: 0.9rem;
    margin-bottom: 16px;
    min-height: 24px;
}

.otp-hint {
    font-size: 0.8rem;
    color: var(--mf-text-light);
    margin-bottom: 24px;
}

/* Success State */
.success-container {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.success-container.visible {
    display: block;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    background: var(--mf-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon svg {
    width: 48px;
    height: 48px;
    color: var(--mf-success);
}

.success-container h2 {
    font-family: var(--red-hat-display), system-ui, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mf-text);
    margin: 0 0 16px;
}

.success-container p {
    font-size: 1.1rem;
    color: var(--mf-text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.app-download-section {
    background: var(--mf-bg-soft);
    padding: 32px;
    border-radius: var(--mf-radius-lg);
    margin-top: 40px;
}

.app-download-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mf-text);
    margin: 0 0 8px;
}

.app-download-section p {
    font-size: 0.95rem;
    color: var(--mf-text-muted);
    margin: 0 0 20px;
}

.app-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.app-links a img {
    height: 48px;
    transition: transform 0.2s ease;
}

.app-links a:hover img {
    transform: scale(1.05);
}

/* FAQ Section */
.faq-section {
    margin-top: 48px;
}

.faq-section h3 {
    font-family: var(--red-hat-display), system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mf-text);
    margin: 0 0 24px;
    text-align: center;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--mf-bg);
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius);
    overflow: hidden;
}

.faq-item-header {
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--mf-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: var(--mf-transition);
}

.faq-item-header:hover {
    background: var(--mf-bg-soft);
}

.faq-item-header svg {
    width: 20px;
    height: 20px;
    color: var(--mf-text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-item-header svg {
    transform: rotate(180deg);
}

.faq-item-content {
    display: none;
    padding: 0 20px 20px;
}

.faq-item.open .faq-item-content {
    display: block;
}

.faq-item-content p,
.faq-item-content li {
    font-size: 0.95rem;
    color: var(--mf-text-muted);
    line-height: 1.7;
}

.faq-item-content ol,
.faq-item-content ul {
    padding-left: 20px;
    margin: 12px 0;
}

.faq-item-content li {
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .membership-container {
        padding: 24px 16px 60px;
    }
    
    .membership-hero {
        padding: 24px 16px;
    }
    
    .membership-hero h1 {
        font-size: 1.75rem;
    }
    
    .membership-hero p {
        font-size: 1rem;
    }
    
    .mf-card-header {
        padding: 20px 20px;
    }
    
    .mf-card-body {
        padding: 24px 20px;
    }
    
    .mf-btn-large {
        padding: 16px 32px;
        font-size: 1rem;
    }
}

/* Hide utility */
.mf-hidden {
    display: none !important;
}

