/* Register Page - Modern Visual Effects */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Animated background with gradient shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer effect animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Loading shimmer for skeleton elements */
@keyframes shimmerLoad {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Floating particles animation */
@keyframes float {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Floating orbs animation */
@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(20px, 30px) scale(1.05);
    }
}

/* Slide up animation for container */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation for error messages */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Spin animation for loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input focus pulse */
@keyframes inputGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* Button hover glow */
@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3), 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6), 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* Step indicator pulse */
@keyframes stepPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== BACKGROUND STYLES ===== */

/* Main wrapper with animated background */
.register-wrapper {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
    padding: 15px;
}

/* Floating background particles */
.register-wrapper::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px;
    animation: float 20s linear infinite;
    pointer-events: none;
}

/* Floating orbs */
.register-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.2), transparent);
    border-radius: 50%;
    top: -50px;
    right: -50px;
    animation: floatOrb 20s ease-in-out infinite;
    pointer-events: none;
}

/* Additional floating orb */
.register-wrapper {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(240, 147, 251, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ===== CONTAINER STYLES ===== */

/* Container with glass-morphism effect */
.register-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        0 0 0 1px rgba(255, 255, 255, 0.18),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    max-width: 900px;
    width: 100%;
    padding: 40px;
    direction: rtl;
    text-align: right;
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    overflow: hidden;
}

.register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 10;
}

.register-container:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 50px 0 rgba(31, 38, 135, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===== HEADER STYLES ===== */

/* Header styling */
.register-header {
    text-align: center;
    margin-bottom: 30px;
}

.register-header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideUp 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: -0.5px;
    position: relative;
}

.register-header h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
    pointer-events: none;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.register-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
    animation: slideUp 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== STEP INDICATOR STYLES ===== */

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 17px;
    right: -10px;
    width: calc(100% + 20px);
    height: 2px;
    background: linear-gradient(90deg, #ddd 0%, #ddd 100%);
    z-index: -1;
    transition: all 0.3s ease;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 35px;
    height: 35px;
    background: rgba(220, 220, 220, 0.5);
    border: 2px solid rgba(220, 220, 220, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    font-size: 14px;
    color: #999;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    animation: stepPulse 1.5s ease-in-out infinite;
}

.step.completed .step-number {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.step.completed::after {
    background: linear-gradient(90deg, #28a745 0%, #28a745 100%);
}

.step-title {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
}

.step.active .step-title {
    color: #667eea;
    font-weight: 600;
}

/* ===== FORM STYLES ===== */

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.form-group {
    margin-bottom: 0;
    flex: 1;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-group.full-width {
    flex: 0 0 100%;
}

.form-label {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
    transition: color 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.form-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 4s infinite;
    pointer-events: none;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        inset 0 0 10px rgba(102, 126, 234, 0.05);
    background: rgba(255, 255, 255, 0.95);
    animation: inputGlow 1.5s ease-in-out;
}

.form-control:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.9);
}

.form-control select {
    cursor: pointer;
    appearance: none;
    padding-left: 40px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
}

/* ===== OTP INPUT STYLES ===== */

.otp-input {
    font-size: 18px;
    letter-spacing: 10px;
    text-align: center !important;
    direction: ltr !important;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ===== OTP INFO BOX ===== */

.otp-info {
    background: linear-gradient(135deg, rgba(231, 243, 255, 0.9), rgba(200, 235, 255, 0.9));
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #004085;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 64, 133, 0.1);
    animation: slideUp 0.5s ease-out;
}

.otp-info p {
    margin: 0;
}

.otp-info strong {
    color: #667eea;
    font-weight: 700;
}

/* ===== PASSWORD REQUIREMENTS ===== */

.password-requirements {
    background: linear-gradient(135deg, rgba(245, 245, 245, 0.9), rgba(250, 250, 250, 0.9));
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 12px;
    border-left: 4px solid #667eea;
    backdrop-filter: blur(10px);
}

.password-requirements p {
    margin: 0 0 8px 0;
    font-weight: 700;
    color: #333;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    padding: 4px 0;
    color: #666;
    position: relative;
    padding-right: 22px;
    transition: all 0.3s ease;
}

.password-requirements li::before {
    content: '?';
    position: absolute;
    right: 0;
    color: #dc3545;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.password-requirements li.valid {
    color: #28a745;
}

.password-requirements li.valid::before {
    content: '?';
    color: #28a745;
    animation: slideUp 0.3s ease-out;
}

/* ===== BUTTON STYLES ===== */

.btn-register,
.btn-back,
.btn-resend {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-register::before,
.btn-back::before,
.btn-resend::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: 2;
}

.btn-register::after,
.btn-back::after,
.btn-resend::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 1;
}

.btn-register {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-register:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    animation: buttonGlow 2s ease-in-out;
}

.btn-register:hover:not(:disabled)::before {
    left: 100%;
}

.btn-back {
    flex: 1;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-back:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 117, 125, 0.4);
}

.btn-back:hover:not(:disabled)::before {
    left: 100%;
}

.btn-resend {
    width: 100%;
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    font-size: 13px;
}

.btn-resend:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.btn-resend:hover:not(:disabled)::before {
    left: 100%;
}

.btn-register:disabled,
.btn-back:disabled,
.btn-resend:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-register:active:not(:disabled),
.btn-back:active:not(:disabled),
.btn-resend:active:not(:disabled) {
    transform: translateY(-1px);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
}

/* ===== MESSAGE STYLES ===== */

.error-message {
    background: linear-gradient(135deg, rgba(248, 215, 218, 0.9), rgba(245, 198, 203, 0.9));
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    direction: rtl;
    animation: shake 0.5s ease-in-out;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(114, 28, 36, 0.2);
    font-size: 13px;
}

.success-message {
    background: linear-gradient(135deg, rgba(212, 237, 218, 0.9), rgba(195, 230, 203, 0.9));
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    direction: rtl;
    animation: slideUp 0.5s ease-out;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(21, 87, 36, 0.2);
    font-size: 13px;
}

.resend-info {
    text-align: center;
    color: #667eea;
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
    animation: slideUp 0.3s ease-out;
}

/* ===== SPINNER STYLES ===== */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* ===== VALIDATION STYLES ===== */

.validation-error {
    color: #dc3545;
    font-size: 11px;
    margin-top: 4px;
    direction: rtl;
    animation: slideUp 0.3s ease-out;
    font-weight: 500;
}

/* ===== LINK STYLES ===== */

.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.login-link p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.login-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
}

.login-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.login-link a:hover {
    color: #764ba2;
}

.login-link a:hover::after {
    width: 100%;
}

/* ===== FOOTER STYLES ===== */

.footer-text {
    text-align: center;
    color: #999;
    font-size: 11px;
    margin-top: 20px;
    animation: slideUp 1.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== SCROLLBAR STYLES ===== */

.register-container::-webkit-scrollbar {
    width: 8px;
}

.register-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.register-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.register-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
    .register-container {
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .register-wrapper {
        padding: 10px;
    }

    .register-container {
        max-width: 95%;
        padding: 25px 20px;
    }

    .register-header h1 {
        font-size: 22px;
    }

    .register-header p {
        font-size: 13px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn-register,
    .btn-back {
        width: 100%;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 13px;
    }

    .step-indicator {
        gap: 15px;
        margin-bottom: 20px;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .step-title {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .register-wrapper {
        padding: 5px;
        min-height: 100vh;
    }

    .register-container {
        padding: 15px;
        border-radius: 12px;
        max-height: none;
    }

    .register-header h1 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .register-header p {
        font-size: 12px;
    }

    .step-indicator {
        gap: 10px;
        margin-bottom: 15px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .step-title {
        font-size: 9px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-control {
        padding: 10px;
        font-size: 13px;
    }

    .btn-register,
    .btn-back,
    .btn-resend {
        padding: 10px 16px;
        font-size: 12px;
    }

    .button-group {
        gap: 8px;
        margin-top: 15px;
    }

    .error-message,
    .success-message {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .register-container {
        background: rgba(45, 50, 80, 0.95);
        color: #f0f0f0;
    }

    .register-header h1 {
        background: linear-gradient(135deg, #7a8fff 0%, #9b7ed4 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .form-label {
        color: #e0e0e0;
    }

    .form-control {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(122, 143, 255, 0.3);
        color: #f0f0f0;
    }

    .form-control:focus {
        background: rgba(255, 255, 255, 0.15);
    }

    .step-title {
        color: #b0b0b0;
    }

    .password-requirements {
        background: rgba(255, 255, 255, 0.05);
        color: #d0d0d0;
    }

    .otp-info {
        background: rgba(0, 64, 133, 0.3);
        border-color: rgba(102, 126, 234, 0.4);
        color: #a0d1ff;
    }

    .login-link {
        border-top-color: rgba(102, 126, 234, 0.3);
    }

    .login-link p {
        color: #b0b0b0;
    }

    .footer-text {
        color: #808080;
    }
}
