/* ============================================
   REGISTER PAGE - Complete Styles
   ============================================ */

:root {
    --social-bg: #d7b7f7;
    --social-surface: #FFFFFF;
    --social-border: #E5E5EB;
    --social-radius: 24px;
    --social-radius-sm: 12px;
    --morph-transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    --register-primary: #6C63FF;
    --register-primary-dark: #5a52e0;
    --register-success: #10B981;
    --register-danger: #EF4444;
    --register-text: #0A0A0F;
    --register-text-light: #6B6B76;
    --register-border: #E5E5EB;
    --register-bg: #F8F8FA;
    --register-shadow: 0 20px 60px rgba(0,0,0,0.1);
    --register-radius: 24px;
    --register-transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.register-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* ============================================
   BACK BUTTON
   ============================================ */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: 40px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    transition: var(--register-transition);
}

.back-home:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(-4px);
}

/* ============================================
   HERO
   ============================================ */
.register-hero {
    text-align: center;
    margin-bottom: 40px;
}

.register-hero h1 {
    font-family: 'Space Grotesk', monospace;
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.register-hero p {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
}

/* ============================================
   ROLE SELECTION CARDS
   ============================================ */
.role-selector {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.role-card {
    background: white;
    border-radius: var(--register-radius);
    padding: 40px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--register-transition);
    width: 320px;
    border: 3px solid transparent;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.role-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.role-card.selected {
    border-color: var(--register-primary);
    box-shadow: 0 20px 40px rgba(108,99,255,0.2);
}

.role-card .role-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.role-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--register-text);
}

.role-card p {
    color: var(--register-text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.role-card .role-features {
    text-align: left;
    margin-top: 20px;
    list-style: none;
}

.role-card .role-features li {
    padding: 4px 0;
    font-size: 0.9rem;
    color: var(--register-text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-card .role-features li i {
    color: var(--register-success);
    font-size: 0.9rem;
}

.role-card .selected-check {
    display: none;
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--register-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(108,99,255,0.3);
}

.role-card.selected .selected-check {
    display: flex;
}

/* ============================================
   FORMS CONTAINER
   ============================================ */
.forms-container {
    background: white;
    border-radius: var(--register-radius);
    padding: 48px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--register-shadow);
}

/* ============================================
   STEP INDICATOR
   ============================================ */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 20px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--register-border);
}

.step-indicator .step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step .step-number {
    width: 36px;
    height: 36px;
    background: var(--register-border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 6px;
    transition: var(--register-transition);
    font-size: 14px;
}

.step.active .step-number {
    background: var(--register-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108,99,255,0.3);
}

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

.step .step-label {
    font-size: 12px;
    color: var(--register-text-light);
    font-weight: 500;
}

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

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--register-text);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--register-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--register-transition);
    background: var(--register-bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--register-primary);
    box-shadow: 0 0 0 4px rgba(108,99,255,0.08);
    background: white;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--register-danger);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 4px rgba(239,68,68,0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.password-input-wrapper .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--register-text-light);
    cursor: pointer;
    padding: 8px;
    font-size: 1rem;
    transition: var(--register-transition);
}

.password-input-wrapper .toggle-password:hover {
    color: var(--register-text);
}

/* Password Strength */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    background: var(--register-border);
    transition: var(--register-transition);
    overflow: hidden;
}

.password-strength .strength-bar {
    height: 100%;
    transition: var(--register-transition);
    border-radius: 2px;
}

.password-strength .strength-bar.weak {
    width: 25%;
    background: var(--register-danger);
}

.password-strength .strength-bar.medium {
    width: 50%;
    background: #F59E0B;
}

.password-strength .strength-bar.strong {
    width: 75%;
    background: #3B82F6;
}

.password-strength .strength-bar.very-strong {
    width: 100%;
    background: var(--register-success);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--register-primary);
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-group label span {
    font-size: 0.9rem;
    color: var(--register-text-light);
}

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

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

/* Field Error */
.field-error {
    font-size: 0.8rem;
    color: var(--register-danger);
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
}

/* ============================================
   PHONE INPUT & COUNTRY SELECTOR STYLES
   ============================================ */

/* ============================================
   PHONE INPUT WRAPPER
   ============================================ */
.phone-input-group {
    margin-bottom: 20px;
}

.phone-input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--morph-text, #0A0A0F);
    font-size: 0.9rem;
}

.phone-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
    position: relative;
}

/* ============================================
   COUNTRY SELECTOR
   ============================================ */
.country-select {
    padding: 12px 8px 12px 12px;
    border: 2px solid var(--morph-border, #E5E5EB);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: var(--morph-surface, #FFFFFF);
    min-width: 100px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B76' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    color: var(--morph-text, #0A0A0F);
}

.country-select:hover {
    border-color: #6C63FF;
}

.country-select:focus {
    outline: none;
    border-color: #6C63FF;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.08);
}

.country-select optgroup {
    font-weight: 600;
    color: var(--morph-text, #0A0A0F);
    padding: 4px 0;
}

.country-select option {
    font-weight: 400;
    padding: 4px 8px;
}

.country-select option:hover {
    background: rgba(108, 99, 255, 0.08);
}

/* ============================================
   PHONE INPUT
   ============================================ */
.phone-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--morph-border, #E5E5EB);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: var(--morph-surface, #FFFFFF);
    transition: all 0.2s ease;
    color: var(--morph-text, #0A0A0F);
    min-width: 0;
}

.phone-input::placeholder {
    color: var(--morph-text-light, #6B6B76);
    font-weight: 400;
}

.phone-input:hover {
    border-color: #6C63FF;
}

.phone-input:focus {
    outline: none;
    border-color: #6C63FF;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.08);
}

/* ============================================
   VALIDATION STATES
   ============================================ */
.phone-input.valid {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.phone-input.invalid {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.country-select.valid {
    border-color: #10B981;
}

.country-select.invalid {
    border-color: #EF4444;
}

/* ============================================
   PHONE FORMAT HINT
   ============================================ */
.phone-format-hint {
    font-size: 0.75rem;
    color: var(--morph-text-light, #6B6B76);
    margin-top: 6px;
    transition: all 0.3s ease;
    min-height: 20px;
    padding: 0 4px;
}

.phone-format-hint.valid {
    color: #10B981;
}

.phone-format-hint.invalid {
    color: #EF4444;
}

.phone-format-hint .example {
    color: var(--morph-text-light, #6B6B76);
    font-size: 0.7rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .phone-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .country-select {
        width: 100%;
        min-width: unset;
        padding: 10px 12px 10px 14px;
    }

    .phone-input {
        width: 100%;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .country-select {
        font-size: 0.85rem;
        padding: 8px 10px 8px 12px;
        min-width: 80px;
        background-position: right 8px center;
        padding-right: 28px;
    }

    .phone-input {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .country-select{
        background: var(--morph-surface, #5c5c5c);
        color: var(--morph-text, #F8F8FA);
        border-color: var(--morph-border, #2D2D44);
    }

    .country-select option {
        background: var(--morph-surface, #5c5c5c);
        color: var(--morph-text, #F8F8FA);
    }

    .country-select optgroup {
        color: var(--morph-text, #F8F8FA);
    }

    .phone-input::placeholder {
        color: var(--morph-text-light, #8B8B9B);
    }

    .country-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B8B9B' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    }
}


/* ============================================
   DISABLED STATE
   ============================================ */
.country-select:disabled,
.phone-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--morph-bg, #F8F8FA);
}

/* ============================================
   READY STATE
   ============================================ */
.phone-input:read-only {
    background: var(--morph-bg, #F8F8FA);
    cursor: default;
}

.field-error {
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
}

.field-error.success {
    color: #10B981;
}

.field-error.error {
    color: #EF4444;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--register-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: var(--register-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--register-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,99,255,0.3);
}

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

.btn-primary .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-secondary {
    background: var(--register-border);
    color: var(--register-text);
    border: none;
    padding: 14px 28px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: var(--register-transition);
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #d0d0d8;
}

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

/* ============================================
   LOGIN LINK
   ============================================ */
.login-link {
    text-align: center;
    margin-top: 24px;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
}

.login-link a {
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    transition: var(--register-transition);
}

.login-link a:hover {
    border-bottom-color: white;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--register-text);
    color: white;
    padding: 14px 32px;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    pointer-events: none;
    max-width: 90%;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--register-success);
}

.toast.error {
    background: var(--register-danger);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--morph-border);
}

.divider span {
    padding: 0 16px;
    font-size: 0.85rem;
    color: var(--morph-text-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }
    
    .register-hero h1 {
        font-size: 2rem;
    }
    
    .register-hero p {
        font-size: 0.95rem;
    }
    
    .role-selector {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .role-card {
        width: 100%;
        max-width: 380px;
        padding: 32px 24px;
    }
    
    .forms-container {
        padding: 32px 20px;
    }
    
    .step-indicator {
        padding: 0 8px;
    }
    
    .step-indicator::before {
        left: 20px;
        right: 20px;
    }
    
    .step .step-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .register-hero h1 {
        font-size: 1.6rem;
    }
    
    .role-card {
        padding: 24px 16px;
    }
    
    .role-card .role-icon {
        font-size: 48px;
    }
    
    .role-card h2 {
        font-size: 1.2rem;
    }
    
    .forms-container {
        padding: 24px 16px;
        border-radius: 16px;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 12px 20px;
    }
    
    .toast {
        font-size: 0.85rem;
        padding: 12px 20px;
        width: 90%;
    }
}