/**
 * SACCO Registration Form Styles
 */

:root {
    --sacco-primary: #2e7d32;
    --sacco-primary-dark: #1b5e20;
    --sacco-primary-light: #4caf50;
    --sacco-secondary: #1565c0;
    --sacco-success: #43a047;
    --sacco-warning: #f57c00;
    --sacco-danger: #d32f2f;
    --sacco-gray: #757575;
    --sacco-light-gray: #f5f5f5;
    --sacco-border: #e0e0e0;
    --sacco-white: #ffffff;
    --sacco-text: #212121;
    --sacco-text-light: #757575;
}

.sacco-registration-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: var(--sacco-text);
}

.sacco-form-container {
    background: var(--sacco-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    overflow: hidden;
}

.sacco-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--sacco-light-gray);
}

.sacco-form-header h2 {
    color: var(--sacco-primary);
    font-size: 28px;
    margin: 0 0 10px;
    font-weight: 700;
}

.sacco-form-header p {
    color: var(--sacco-text-light);
    font-size: 16px;
    margin: 0;
}

/* Progress Steps */
.sacco-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 10px;
}

.sacco-progress-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.sacco-progress-steps .step::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: var(--sacco-border);
    z-index: 0;
}

.sacco-progress-steps .step:last-child::after {
    display: none;
}

.sacco-progress-steps .step.active::after,
.sacco-progress-steps .step.completed::after {
    background: var(--sacco-primary);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sacco-border);
    color: var(--sacco-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    z-index: 1;
    transition: all 0.3s ease;
}

.sacco-progress-steps .step.active .step-number,
.sacco-progress-steps .step.completed .step-number {
    background: var(--sacco-primary);
}

.step-label {
    font-size: 12px;
    color: var(--sacco-gray);
    margin-top: 8px;
    text-align: center;
}

.sacco-progress-steps .step.active .step-label {
    color: var(--sacco-primary);
    font-weight: 600;
}

/* Form Elements */
.sacco-form-group {
    margin-bottom: 20px;
}

.sacco-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .sacco-form-row {
        grid-template-columns: 1fr;
    }
}

.sacco-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--sacco-text);
    font-size: 14px;
}

.sacco-form-group label .required {
    color: var(--sacco-danger);
}

.sacco-input,
.sacco-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sacco-border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--sacco-white);
    box-sizing: border-box;
}

.sacco-input:focus,
.sacco-select:focus {
    outline: none;
    border-color: var(--sacco-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.sacco-input.error,
.sacco-select.error {
    border-color: var(--sacco-danger);
}

.sacco-input.valid {
    border-color: var(--sacco-success);
}

.sacco-hint {
    display: block;
    font-size: 12px;
    color: var(--sacco-text-light);
    margin-top: 6px;
}

/* Checkbox */
.sacco-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.sacco-checkbox input {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: var(--sacco-primary);
    cursor: pointer;
}

.sacco-checkbox a {
    color: var(--sacco-primary);
    text-decoration: none;
}

.sacco-checkbox a:hover {
    text-decoration: underline;
}

/* Buttons */
.sacco-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sacco-btn-primary {
    background: var(--sacco-primary);
    color: var(--sacco-white);
}

.sacco-btn-primary:hover {
    background: var(--sacco-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.sacco-btn-secondary {
    background: var(--sacco-light-gray);
    color: var(--sacco-text);
}

.sacco-btn-secondary:hover {
    background: #e0e0e0;
}

.sacco-btn-text {
    background: none;
    border: none;
    color: var(--sacco-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

.sacco-btn-text:hover {
    text-decoration: underline;
}

.sacco-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Actions */
.sacco-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--sacco-light-gray);
}

.sacco-form-actions.center {
    justify-content: center;
}

/* Form Footer */
.sacco-form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--sacco-light-gray);
    color: var(--sacco-text-light);
    font-size: 14px;
}

.sacco-form-footer a {
    color: var(--sacco-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Alerts */
.sacco-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.sacco-alert-success {
    background: #e8f5e9;
    color: var(--sacco-success);
    border-left: 4px solid var(--sacco-success);
}

.sacco-alert-error {
    background: #ffebee;
    color: var(--sacco-danger);
    border-left: 4px solid var(--sacco-danger);
}

.sacco-alert-warning {
    background: #fff3e0;
    color: var(--sacco-warning);
    border-left: 4px solid var(--sacco-warning);
}

.sacco-alert-info {
    background: #e3f2fd;
    color: var(--sacco-secondary);
    border-left: 4px solid var(--sacco-secondary);
}

/* OTP Section */
.sacco-otp-verification {
    background: var(--sacco-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
}

.sacco-otp-verification .sacco-form-header {
    border-bottom: none;
}

.sacco-otp-verification form {
    max-width: 400px;
    margin: 0 auto;
}

.sacco-otp-timer {
    margin-top: 20px;
    font-size: 14px;
    color: var(--sacco-text-light);
}

.sacco-otp-timer span {
    font-weight: 600;
    color: var(--sacco-warning);
}

/* OTP Input Styling */
.sacco-otp-input-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#otp_code {
    width: 200px;
    padding: 16px 20px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid var(--sacco-border);
    border-radius: 12px;
    background: var(--sacco-white);
    color: var(--sacco-text);
    font-weight: 600;
    transition: all 0.3s ease;
}

#otp_code:focus {
    outline: none;
    border-color: var(--sacco-primary);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.15);
}

#otp_code.error {
    border-color: var(--sacco-danger);
    animation: shake 0.5s ease;
}

#otp_code.valid {
    border-color: var(--sacco-success);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.sacco-otp-hint {
    font-size: 13px;
    color: var(--sacco-text-light);
    margin-top: 8px;
}

/* Registration Confirmation */
.sacco-registration-confirmation {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 2px solid var(--sacco-primary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: left;
}

.sacco-confirmation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.sacco-confirmation-header .check-icon {
    width: 40px;
    height: 40px;
    background: var(--sacco-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sacco-confirmation-header h3 {
    margin: 0;
    color: var(--sacco-primary-dark);
    font-size: 18px;
}

.sacco-confirmation-message {
    color: var(--sacco-text);
    margin-bottom: 15px;
    line-height: 1.6;
}

.sacco-masked-contact {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--sacco-text);
}

.sacco-masked-contact strong {
    color: var(--sacco-primary-dark);
}

.sacco-masked-contact .contact-icon {
    margin-right: 8px;
    color: var(--sacco-primary);
}

/* Security Badge */
.sacco-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: var(--sacco-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.sacco-security-badge svg {
    width: 14px;
    height: 14px;
}

.sacco-back-link {
    margin-top: 30px;
}

.sacco-back-link a {
    color: var(--sacco-primary);
    text-decoration: none;
    font-size: 14px;
}

/* Success Page */
.sacco-success-page {
    background: var(--sacco-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    text-align: center;
}

.sacco-success-icon {
    width: 80px;
    height: 80px;
    background: var(--sacco-success);
    color: var(--sacco-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.sacco-success-page h2 {
    color: var(--sacco-success);
    margin-bottom: 15px;
}

.sacco-success-page p {
    color: var(--sacco-text-light);
    margin-bottom: 10px;
}

/* Response Messages */
.sacco-response {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.sacco-response.success {
    background: #e8f5e9;
    color: var(--sacco-success);
    border: 1px solid var(--sacco-success);
}

.sacco-response.error {
    background: #ffebee;
    color: var(--sacco-danger);
    border: 1px solid var(--sacco-danger);
}

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

/* Section Title */
.section-title {
    font-size: 18px;
    color: var(--sacco-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--sacco-light-gray);
}

/* Loading Spinner */
.sacco-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sacco-form-container {
        padding: 25px;
    }

    .sacco-form-header h2 {
        font-size: 24px;
    }

    .sacco-progress-steps .step-label {
        font-size: 10px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sacco-registration-wrapper {
        padding: 10px;
    }

    .sacco-form-container {
        padding: 20px;
        border-radius: 8px;
    }

    .sacco-form-actions {
        flex-direction: column;
    }

    .sacco-btn {
        width: 100%;
    }
}