/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #171717;
    --bg-secondary: #212121;
    --bg-card: #282828;
    --bg-input: #2d2d2d;
    --bg-button: #1a1a1a;
    --bg-button-hover: #333333;
    --border-color: #4a4a4a;
    --border-color-light: #6c6c6c;
    --text-primary: #D8D8D8;
    --text-secondary: #8c8c8c;
    --text-light: #bfbfbf;
    --error-color: #e9322d;
    --error-bg: rgba(233, 50, 45, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-size: 15px;
    line-height: 1.5;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.login-box {
    width: 100%;
    background-color: var(--bg-card);
    border-radius: 10px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px var(--shadow);
}

/* Logo */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-image {
    width: 240px;
    height: 240px;
    object-fit: contain;
}

/* Title */
.login-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background-color: var(--error-bg);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.alert-text {
    font-size: 14px;
    line-height: 1.4;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--border-color-light);
    background-color: var(--bg-secondary);
}

.input-field:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-field::placeholder {
    color: var(--text-secondary);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .input-field {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.eye-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 14px 20px;
    background-color: var(--bg-button);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-button:hover:not(:disabled) {
    background-color: var(--bg-button-hover);
    border-color: var(--border-color-light);
}

.login-button:active:not(:disabled) {
    transform: translateY(1px);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-text {
    display: inline-block;
}

.button-arrow {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.footer-link-active {
    color: var(--text-primary);
    text-decoration: underline;
    cursor: pointer;
}

.footer-link-active:hover {
    color: var(--text-light);
    text-decoration: underline;
}

/* Back Link */
.back-link-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.back-link {
    color: var(--text-primary);
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-light);
}

/* Page Footer */
.page-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 20px;
}

/* Error State for Input */
.input-field.error {
    border-color: var(--error-color);
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .login-title {
        font-size: 20px;
    }

    .logo-image {
        width: 180px;
        height: 180px;
    }
}