/* Optimized CSS for login.html - Performance improvements */
/* Moved from inline styles to external file for better caching */

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    /* Performance optimization */
    will-change: auto;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
    /* Performance optimization */
    will-change: transform;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #58cc02, #1cb0f6);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #1cb0f6, #58cc02);
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.bg-circle-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #fbbf24, #58cc02);
    top: 50%;
    right: -75px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}

.container {
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 10;
    margin: 0 auto;
}

.registration-card {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #58cc02, #45a300);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 10px 30px rgba(88, 204, 2, 0.3);
    animation: bounce 2s infinite;
    /* Performance optimization */
    will-change: transform;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #58cc02, #1cb0f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-subtitle {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

h2 {
    color: #f1f5f9;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    text-align: center;
}

.subtitle {
    color: #94a3b8;
    text-align: center;
    margin-bottom: 32px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

label {
    display: block;
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.required {
    color: #ef4444;
    margin-left: 4px;
}

.input-wrapper {
    position: relative;
}

input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 44px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    /* Performance optimization */
    will-change: border-color, background, box-shadow;
}

/* Autofill detection for Chrome/Edge/Safari */
@keyframes onAutoFillStart {
    from { opacity: 1; }
    to { opacity: 1; }
}

@keyframes onAutoFillCancel {
    from { opacity: 1; }
    to { opacity: 1; }
}

input:-webkit-autofill {
    animation-name: onAutoFillStart;
    transition: background-color 50000s ease-in-out 0s;
    -webkit-text-fill-color: #f1f5f9 !important;
}

input:not(:-webkit-autofill) {
    animation-name: onAutoFillCancel;
}

input:focus {
    border-color: #58cc02;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.1);
}

input.valid {
    border-color: #58cc02;
}

input.invalid {
    border-color: #ef4444;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Performance optimization */
    will-change: opacity;
}

input.valid ~ .input-icon.success {
    opacity: 1;
}

input.invalid ~ .input-icon.error {
    opacity: 1;
}

.helper-text {
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.helper-text.info {
    color: #94a3b8;
}

.helper-text.error {
    color: #ef4444;
}

.helper-text.success {
    color: #58cc02;
}

.helper-text span {
    font-size: 14px;
}

.contact-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.toggle-option {
    flex: 1;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #94a3b8;
    font-weight: 600;
    font-size: 14px;
    /* Performance optimization */
    will-change: background, border-color, color;
}

.toggle-option:hover {
    border-color: rgba(88, 204, 2, 0.4);
    background: rgba(88, 204, 2, 0.05);
}

.toggle-option.active {
    background: rgba(88, 204, 2, 0.1);
    border-color: #58cc02;
    color: #58cc02;
}

.toggle-option span {
    font-size: 18px;
    margin-right: 6px;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #58cc02, #45a300);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 32px;
    box-shadow: 0 10px 30px rgba(88, 204, 2, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Performance optimization */
    will-change: transform, box-shadow;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(88, 204, 2, 0.4);
}

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

.btn-submit:disabled {
    background: rgba(148, 163, 184, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.login-link {
    text-align: center;
    margin-top: 24px;
    color: #94a3b8;
    font-size: 15px;
}

.login-link a {
    color: #1cb0f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-link a:hover {
    color: #58cc02;
    text-decoration: underline;
}

.success-message {
    display: none;
    text-align: center;
    padding: 32px;
}

.success-message.show {
    display: block;
}

.success-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: successPop 0.5s ease;
    /* Performance optimization */
    will-change: transform;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-title {
    color: #58cc02;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.success-text {
    color: #94a3b8;
    font-size: 16px;
    margin-bottom: 32px;
}

.btn-continue {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #58cc02, #45a300);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    /* Performance optimization */
    will-change: transform, box-shadow;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 204, 2, 0.4);
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
    animation: pulse-whatsapp 2s infinite;
    /* Performance optimization */
    will-change: transform, box-shadow;
}

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6); }
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6);
}

/* Error message styles */
#loginError {
    color: #ef4444;
    text-align: center;
    margin: 16px 0;
    font-weight: 600;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: errorSlideIn 0.3s ease-out;
    /* Performance optimization */
    will-change: opacity, transform;
}

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

/* Django Messages Animation */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    .registration-card {
        padding: 32px 24px;
        width: 100%;
        max-width: 100%;
    }
    .logo {
        width: 70px;
        height: 70px;
        font-size: 40px;
    }
    .logo-title {
        font-size: 28px;
    }
    h2 {
        font-size: 24px;
    }
    .btn-submit {
        font-size: 16px;
    }
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    .container {
        max-width: 100%;
        width: 100%;
    }
    .registration-card {
        padding: 24px 16px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
    }
    .logo {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    .logo-title {
        font-size: 24px;
    }
    .logo-subtitle {
        font-size: 14px;
    }
    h2 {
        font-size: 22px;
    }
    .subtitle {
        font-size: 14px;
    }
    input {
        padding: 12px 14px;
        padding-right: 40px;
        font-size: 15px;
        width: 100%;
    }
    .btn-submit {
        padding: 14px;
        font-size: 15px;
        width: 100%;
    }
    .whatsapp-float {
        width: 45px;
        height: 45px;
        bottom: 16px;
        right: 16px;
    }
    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}
