/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('assets/bg-main.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header .logo {
    max-width: 500px;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Form Container */
.content-container {
    background: url('assets/bg-form.png') no-repeat center center;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    position: relative;
}

.form-section {
    padding: 20px 60px 80px 100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-section form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-section.hidden {
    display: none;
}

.form-section h2 {
    padding-top: 80px;
    text-align: center;
    margin-bottom: 10px;
    color: #4b4c58;
    font-weight: 600;
    font-size: 1.8rem;
    width: 100%;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

/* Form Groups */
.form-group {
    margin-bottom: 15px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-group label {
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    display: block;
    margin-bottom: 0px;
    font-weight: 500;
    color: #4b4c58;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    width: 100%;
}

.form-group input {
    width: 100%;
    padding: 8px 15px;
    border: 2px solid #54606c;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: left;
    background-color: #62646f; /* Light grey background */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3); /* Soft black inner glow */
}

.form-group input:focus {
    outline: none;
    border-color: #868997;
    background-color: #62646f; /* Light grey background */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(102, 126, 234, 0.1); /* Keep inner glow + focus ring */
}

/* Input Container and Validation Icons */
.input-container {
    position: relative;
    width: 110%;
    display: flex;
    align-items: center;
    min-height: 50px; /* Ensure container has height for absolute positioning */
    justify-content: flex-start;
}

.input-container input {
    flex: 1;
    width: 100%;
}

.validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10; /* Ensure icons are above other elements */
}

.validation-icon.valid {
    background-image: url('assets/Tick.png');
    opacity: 1;
}

.validation-icon.invalid {
    background-image: url('assets/Cross.png');
    opacity: 1;
}

/* Tooltip styles */
.input-container {
    position: relative;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    margin-bottom: 8px;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    visibility: visible;
    min-width: 120px;
    text-align: center;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.tooltip.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Remove the old username-status styles */
.username-status {
    display: none;
}



/* Buttons */
.btn {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin: 0;
}

.btn-primary {
    position: relative;
    background: url('assets/Button.png') no-repeat center center;
    color: white;
    overflow: hidden;
}

.btn-primary span {
    position: relative;
    z-index: 10;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/ButtonHover.png') no-repeat center center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/ButtonPress.png') no-repeat center center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active::after {
    opacity: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Footer */
.form-footer {
    text-align: left;
    margin-top: 20px;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #764ba2;
}

/* Messages */
.message-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

.message-container.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-container.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-container.hidden {
    display: none;
}

/* Loading Spinner */
.loading {
    text-align: center;
    margin-top: 20px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #7f8c8d;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .content-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .vertical-divider {
        display: none;
    }
    
    .links-section {
        order: 3;
        padding: 30px 25px;
    }
    
    .form-section {
        padding: 30px 25px;
    }
    
    .form-section h2 {
        font-size: 1.5rem;
    }
    
    .links-section h2 {
        font-size: 1.5rem;
        padding-top: 40px;
    }
    
    .links-grid {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .links-section {
        padding: 25px 20px;
    }
    
    .btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Animation for form switching */
.form-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input validation styles */
.form-group input.valid {
    border-color: #27ae60;
    background: #f8fff9;
}

.form-group input.invalid {
    border-color: #e74c3c;
    background: #fff8f8;
}

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.message-container.success {
    animation: successPulse 0.5s ease-in-out;
}

/* Vertical Divider */
.vertical-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
}

.divider-image {
    max-height: 400px;
    width: auto;
    object-fit: contain;
}

/* Links Section */
.links-section {
    padding: 40px 60px 80px 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.links-section h2 {
    padding-top: 60px;
    text-align: center;
    margin-bottom: 30px;
    color: #4b4c58;
    font-weight: 600;
    font-size: 1.8rem;
    width: 100%;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.links-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 30px 30px;
    background: url('assets/LinkOverlay.png') no-repeat center center;
    background-size: 100% 100%;
    transition: all 0.3s ease;
    position: relative;
}

.link-item:hover {
    background: url('assets/LinkOverlayHover.png') no-repeat center center;
    background-size: 100% 100%;
}


.link-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.discord-icon {
    object-fit: contain;
    flex-shrink: 0;
}

.link-text {
    padding-left: 10px;
}
