/* signup.css - Split Form Signup Interface */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Mitr', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modern background with blur */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.25) 0%, transparent 60%),
        url('https://images.unsplash.com/photo-1563013544-824ae1b704d3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    filter: blur(6px) brightness(1.05);
}

/* Signup Container */
.signup-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.signup-container {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: 35px;
    position: relative;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Custom scrollbar */
.signup-container::-webkit-scrollbar {
    width: 6px;
}

.signup-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.signup-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.signup-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.language-btn:hover {
    border-color: var(--primary);
}

.language-btn i:first-child {
    color: var(--primary);
    font-size: 14px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.language-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-light);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--primary-light);
}

.language-option.active {
    background: var(--primary-light);
    color: var(--primary);
}

.language-flag {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Header */
.signup-header {
    text-align: center;
    margin-bottom: 25px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    overflow: hidden;
    background: white;
    padding: 5px;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.header-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Progress Steps - ALWAYS SIDE BY SIDE */
.form-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    gap: 15px;
    width: 100%;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    position: relative;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    z-index: 2;
}

.step.active .step-circle {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.step.completed .step-circle {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step.completed .step-circle i {
    display: block;
}

.step.completed .step-circle span {
    display: none;
}

.step-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 5px;
}

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

.step-line {
    height: 2px;
    flex: 1;
    max-width: 40px;
    background: var(--border);
    margin-top: 17px;
    align-self: flex-start;
    position: relative;
    z-index: 1;
}

/* Form Elements */
.signup-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

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

.form-label i {
    color: var(--primary);
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.required {
    color: var(--error);
    font-size: 14px;
}

.optional {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 400;
    margin-left: 5px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
    z-index: 1;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
    font-size: 14px;
}

.form-input.error {
    border-color: var(--error);
    background-color: rgba(240, 68, 56, 0.05);
}

/* Country code for phone */
.country-code {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    z-index: 2;
}

.phone-input {
    padding-left: 65px !important;
}

/* Password Input */
.password-input {
    padding-left: 42px;
    padding-right: 46px;
}

.pin-input {
    padding-left: 42px;
    letter-spacing: 8px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Input hints */
.input-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    line-height: 1.4;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.terms-link:hover {
    text-decoration: underline;
}

/* Links */
.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

.login-btn i {
    font-size: 13px;
}

/* Toast Notification - Top Right */
.toast {
    position: fixed;
    top: 20px;
    right: -400px;
    max-width: 350px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1002;
    border-left: 4px solid var(--primary);
    overflow: hidden;
}

.toast.show {
    right: 20px;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
    color: var(--primary);
    margin-top: 1px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-text {
    flex: 1;
}

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

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    backdrop-filter: blur(3px);
}

.loading-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.loader {
    text-align: center;
    background: var(--surface);
    padding: 25px;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    max-width: 250px;
    width: 90%;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .signup-wrapper {
        padding: 15px;
        padding-top: 70px;
    }
    
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .signup-container {
        padding: 30px 25px;
        max-width: 420px;
        border-radius: 16px;
        max-height: 85vh;
    }
    
    .logo-circle {
        width: 75px;
        height: 75px;
        margin-bottom: 18px;
    }
    
    .logo {
        height: 48px;
    }
    
    .header-content h1 {
        font-size: 22px;
    }
    
    .header-content p {
        font-size: 13px;
    }
    
    /* Steps on tablet */
    .form-steps {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .step-label {
        font-size: 11px;
        padding: 0 2px;
    }
    
    .step-line {
        max-width: 30px;
        margin-top: 15px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-input {
        height: 46px;
        font-size: 14px;
    }
    
    .nav-btn {
        height: 44px;
        padding: 0 20px;
        font-size: 13px;
    }
    
    .toast {
        max-width: 320px;
        top: 15px;
        right: -350px;
        padding: 12px 14px;
    }
    
    .toast.show {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .signup-wrapper {
        padding: 12px;
        padding-top: 65px;
    }
    
    .signup-container {
        padding: 25px 20px;
        max-width: 380px;
        border-radius: 14px;
        max-height: 80vh;
    }
    
    .logo-circle {
        width: 70px;
        height: 70px;
    }
    
    .logo {
        height: 45px;
    }
    
    .header-content h1 {
        font-size: 20px;
    }
    
    /* Steps on mobile - SIDE BY SIDE */
    .form-steps {
        flex-direction: row !important;
        gap: 5px;
        margin-bottom: 20px;
    }
    
    .step {
        flex-direction: column;
        gap: 6px;
        flex: 1;
    }
    
    .step-line {
        display: block !important;
        height: 2px;
        flex: 1;
        max-width: 20px;
        margin-top: 15px;
    }
    
    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .step-label {
        font-size: 10px;
        line-height: 1.2;
    }
    
    .form-input {
        height: 44px;
        padding: 0 12px;
        font-size: 14px;
    }
    
    .phone-input {
        padding-left: 60px !important;
    }
    
    .password-input,
    .pin-input {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    .input-icon {
        left: 12px;
    }
    
    .password-toggle {
        right: 12px;
    }
    
    .country-code {
        left: 12px;
        font-size: 14px;
    }
    
    .nav-btn {
        height: 42px;
        padding: 0 16px;
        font-size: 12px;
    }
    
    .login-link {
        margin-top: 22px;
        padding-top: 18px;
        font-size: 13px;
    }
}

/* For very small screens */
@media (max-width: 360px) {
    .form-steps {
        gap: 3px;
    }
    
    .step-label {
        font-size: 9px;
    }
    
    .step-line {
        max-width: 15px;
    }
    
    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
}

/* Animation for form transitions */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}