/* Login Page Styles */
:root {
    --primary-color: #6c5dd3;
    --background-color: #0b0b0f;
    --text-color: #a6a6b1;
    --heading-color: #ffffff;
    --input-background: #1c1c24;
    --input-border: #2c2c35;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100%;
    box-sizing: border-box;
    padding: min(5vh, 2rem) 0;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.back-button {
    color: var(--text-color);
}

.back-button a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-button a:hover {
    color: var(--heading-color);
}

.top-register-button .register-button {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-register-button .register-button:hover {
    background-color: #5648c0;
    transform: translateY(-1px);
}

.top-register-button .register-button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.top-register-button .register-button:hover svg {
    transform: scale(1.1);
}

.login-content {
    margin-top: 1rem;
}

h1 {
    color: var(--heading-color);
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.subtitle {
    color: var(--text-color);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    color: var(--heading-color);
    font-size: 1rem;
    font-weight: 500;
}

input {
    background-color: var(--input-background);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--heading-color);
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

/* Input field focus styles */
input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--input-background);
}

/* Placeholder text styles */
input::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

/* International Phone Input styles */
.iti {
    width: 100%;
    background-color: var(--input-background);
    border-radius: 12px;
    margin-top: 0.25rem;
}

.iti__flag-container:hover .iti__selected-flag {
    background-color: transparent;
}

.iti__selected-flag {
    background-color: transparent !important;
    border-radius: 12px 0 0 12px;
}

.iti__country-list {
    background-color: var(--input-background);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 200px;
}

.iti__country {
    padding: 8px 10px;
    color: var(--text-color);
}

.iti__country:hover {
    background-color: var(--primary-color);
}

.iti__country.iti__highlight {
    background-color: var(--primary-color);
}

.iti__dial-code {
    color: var(--text-color);
}

input[type="tel"] {
    background-color: var(--input-background) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 12px !important;
    padding-left: 85px !important;
}

/* Form validation styles */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ff4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: rgba(255, 68, 68, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.error-message svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

input.error {
    border-color: #ff4444 !important;
}

/* Loading button styles */
.login-button {
    position: relative;
    transition: all 0.3s ease;
}

.login-button.loading {
    background-color: #5648c0;
    pointer-events: none;
}

.login-button.loading .button-text {
    opacity: 0;
}

.login-button .loader {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.login-button.loading .loader {
    display: block;
}

.login-button .loader::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.password-input-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--heading-color);
}

.login-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.login-button:hover {
    background-color: #5648c0;
}

.terms-text {
    font-size: 0.875rem;
    color: var(--text-color);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.5;
}

/* Remove the old register link section as it's now at the top */
.register-link {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
        min-height: 100%;
    }

    .login-container {
        padding: 1.5rem;
        margin: 0 auto;
        min-height: 100%;
        display: flex;
        flex-direction: column;
        width: calc(100% - 2rem);
        max-width: 440px;
    }

    .nav-buttons {
        margin-bottom: 1.5rem;
    }

    .login-content {
        flex: 1;
    }

    h1 {
        font-size: clamp(1.75rem, 5vw, 2rem);
    }

    .subtitle {
        font-size: clamp(0.875rem, 4vw, 1rem);
    }

    input {
        font-size: 16px; /* Prevents zoom on mobile */
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
        width: calc(100% - 2rem);
    }

    .top-register-button .register-button {
        padding: 0.5rem 1rem;
    }

    .top-register-button .register-button svg {
        width: 16px;
        height: 16px;
    }

    .terms-text {
        padding: 0 1rem;
    }
}

/* Handle smaller height screens */
@media (max-height: 700px) {
    body {
        height: auto;
        padding: 1rem 0;
    }

    .login-container {
        margin-bottom: 2rem;
    }
}
