:root {
    --primary: #8a2be2;
    --secondary: #ff6b6b;
    --accent: #2be2d7;
    --dark: #09090f;
    --darker: #05050a;
    --light: #f0f0fa;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-bg: linear-gradient(145deg,
        rgba(25, 20, 50, 0.7), 
        rgba(10, 8, 25, 0.9)
    );
    --success: #00cc66;
    --error: #ff4d4d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Mobile-first base styles */
body {
    min-height: 100vh;
    background-color: var(--darker);
    color: var(--light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 12px;
    overflow-x: hidden;
}

/* Particle background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background: radial-gradient(circle at center, #0a0a1a 0%, #000 70%);
    pointer-events: auto;
}

/* Floating elements - hidden on mobile */
.floating-elements {
    display: none;
}

/* Mobile-first register container */
.register-container {
    width: 100%;
    max-width: 340px;
    padding: 18px;
    backdrop-filter: blur(12px) saturate(180%);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(138, 43, 226, 0.1),
        0 0 30px rgba(43, 226, 215, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards 0.3s;
    pointer-events: auto;
}

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

.register-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle, 
        rgba(138, 43, 226, 0.1) 0%, 
        transparent 70%
    );
    z-index: -1;
    pointer-events: none;
}

/* Header section - mobile optimized */
.header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.logo-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 12px rgba(138, 43, 226, 0.3),
        0 0 24px rgba(43, 226, 215, 0.1);
}

.logo-wrapper svg {
    width: 60%;
    height: 60%;
    fill: white;
}

.title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(to right, var(--light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    max-width: 240px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Form elements - mobile optimized */
.form-group {
    margin-bottom: 14px;
    position: relative;
    pointer-events: auto;
}

.form-group:last-of-type {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    color: var(--light);
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 226, 215, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

/* Password strength meter - compact */
.password-strength {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.password-strength-meter {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
}

/* Submit button - mobile optimized */
.submit-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.3);
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin-top: 6px;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: -150%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: rotate(25deg);
    transition: all 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(138, 43, 226, 0.4),
        0 0 12px rgba(255, 107, 107, 0.3);
}

.submit-btn:hover::after {
    top: -50%;
}

.submit-btn:active {
    transform: translateY(0);
}

/* Links - mobile optimized */
.new {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.new:hover{
    color: var(--accent);
    border-color: rgba(43, 226, 215, 0.3);
    background: rgba(43, 226, 215, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(43, 226, 215, 0.15);
}
.new:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(43, 226, 215, 0.1);
}
.new:focus{
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(43, 226, 215, 0.2);
}

/* Status message */
#registerMessage {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-size: 0.8rem;
}

.success {
    background: rgba(0, 204, 102, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.error {
    background: rgba(255, 77, 77, 0.12);
    color: var(--error);
    border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Footer - hidden on mobile */
footer {
    display: none;
}

/* 480px breakpoint - Enhanced mobile styles */
@media (min-width: 480px) {
    body {
        padding: 16px;
    }
    
    .register-container {
        max-width: 380px;
        padding: 24px;
        border-radius: 20px;
    }
    
    .logo-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }
    
    .title {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }
    
    .subtitle {
        font-size: 0.9rem;
        max-width: 280px;
    }
    
    .header {
        margin-bottom: 24px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group:last-of-type {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 14px;
    }
    
    .form-group input::placeholder {
        font-size: 15px;
    }
    
    .submit-btn {
        padding: 16px;
        font-size: 1rem;
        border-radius: 14px;
        margin-top: 8px;
    }
    
    .new {
        margin-top: 18px;
        font-size: 0.85rem;
        padding: 10px;
    }
    
    #registerMessage {
        margin-top: 16px;
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .password-strength {
        height: 4px;
        margin-top: 8px;
    }
}

/* 768px breakpoint - Tablet styles */
@media (min-width: 768px) {
    body {
        padding: 24px;
        overflow: hidden;
    }
    
    /* Show floating elements on larger screens */
    .floating-elements {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    }
    
    .floating-element {
        position: absolute;
        border-radius: 50%;
        filter: blur(60px);
        opacity: 0.12;
        z-index: 1;
        animation: float 15s infinite ease-in-out;
    }
    
    .floating-element.violet {
        background: radial-gradient(circle, var(--primary), transparent 70%);
    }
    
    .floating-element.accent {
        background: radial-gradient(circle, var(--accent), transparent 70%);
    }
    
    @keyframes float {
        0% { 
            transform: translateY(0) translateX(0); 
        }
        50% { 
            transform: translateY(-15px) translateX(8px); 
        }
        100% { 
            transform: translateY(0) translateX(0); 
        }
    }
    
    .register-container {
        max-width: 420px;
        padding: 2rem;
        border-radius: 24px;
    }
    
    .logo-wrapper {
        width: 90px;
        height: 90px;
        margin-bottom: 1rem;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
        max-width: 320px;
    }
    
    .header {
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group:last-of-type {
        margin-bottom: 1.4rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }
    
    .form-group input {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 1.1rem;
        font-size: 1rem;
    }
    
    .new {
        margin-top: 1rem;
        font-size: 0.9rem;
    }
    
    /* Show footer on larger screens */
    footer {
        display: block;
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        padding: 1rem;
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.8rem;
        background: rgba(0, 0, 0, 0.2);
        z-index: 100;
    }
}

/* Large desktop styles */
@media (min-width: 1024px) {
    .register-container {
        max-width: 440px;
    }
    
    .logo-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
}

/* High resolution displays */
@media (min-width: 1440px) {
    .register-container {
        max-width: 460px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 8px;
    }
    
    .register-container {
        padding: 12px;
        margin: 4px auto;
    }
    
    .logo-wrapper {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }
    
    .title {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .header {
        margin-bottom: 12px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group:last-of-type {
        margin-bottom: 12px;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
    
    .submit-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .new {
        margin-top: 10px;
        font-size: 0.75rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .register-container {
        max-width: 95%;
        padding: 14px;
    }
    
    .title {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
}
