/* Authentication Pages Styles */
/* Shared styles for login, register, and profile pages */

.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100svh; /* Small viewport height - fallback for browsers without dvh */
    height: 100dvh; /* Dynamic viewport height - adjusts to visible viewport on mobile */
    padding: var(--spacing-m);
    background-color: var(--content-bg-color);
}

/* Logo above auth card */
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-m);
    margin-bottom: var(--spacing-xl);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.auth-logo:hover {
    text-decoration: none;
}

.auth-logo img {
    width: 80px;
    height: 80px;
}

.auth-logo h2 {
    color: var(--content-text-color);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.auth-card {
    background-color: var(--content-page-container-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.auth-header h1 {
    color: var(--content-text-color);
    font-size: var(--font-size-3xl);
    margin: 0 0 var(--spacing-s) 0;
    font-weight: var(--font-weight-bold);
}

.auth-header p {
    color: var(--text-secondary-color);
    font-size: var(--font-size-base);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-l);
}

/* Compact form variant */
.auth-form-compact {
    gap: var(--spacing-m);
}

.auth-form-compact .form-group {
    gap: var(--spacing-xs);
}

.auth-form-compact .form-group input {
    height: 42px;
    padding: 0.625rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-s);
}

.form-group label {
    color: var(--content-text-color);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--content-border-color);
    border-radius: var(--radius-m);
    background-color: var(--grey3-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: var(--transition-base);
    transition-property: border-color, box-shadow;
    height: 48px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-button-color);
    box-shadow: 0 0 0 3px var(--glow-primary-40);
}

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

.form-group input.error {
    border-color: var(--error-border);
}

.form-group .error-message {
    color: var(--content-danger-text);
    font-size: var(--font-size-s);
    margin-top: calc(var(--spacing-s) * -0.5);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
    margin-top: var(--spacing-m);
}

.auth-button {
    padding: var(--spacing-m) var(--spacing-xl);
    background-color: var(--primary-button-color);
    color: white;
    border: none;
    border-radius: var(--radius-m);
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-base);
    transition-property: background-color, transform, box-shadow;
}

.auth-button:hover:not(:disabled) {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-m);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-button.secondary {
    background-color: var(--secondary-button-color);
}

.auth-button.secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover-color);
}

.auth-button.danger {
    background-color: #c82333;
}

.auth-button.danger:hover:not(:disabled) {
    background-color: #a71d2a;
}

/* OAuth Buttons */
.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-xl) 0;
    color: var(--text-secondary-color);
    font-size: var(--font-size-s);
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--content-border-color);
}

.oauth-divider span {
    padding: 0 var(--spacing-m);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

.oauth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-m);
    padding: var(--spacing-m);
    background-color: var(--grey3-color);
    color: var(--text-color);
    border: 2px solid var(--content-border-color);
    border-radius: var(--radius-m);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-base);
    transition-property: background-color, border-color;
    height: 48px;
}

.oauth-button-large {
    height: 56px;
    font-size: var(--font-size-l);
    padding: var(--spacing-l);
}

.oauth-button:hover {
    background-color: var(--grey4-color);
    border-color: var(--text-secondary-color);
}

.oauth-button svg,
.oauth-button img {
    width: 20px;
    height: 20px;
}

/* Remember Me & Forgot Password */
.form-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-s);
    margin-top: calc(var(--spacing-m) * -0.5);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: var(--spacing-s);
    color: var(--text-secondary-color);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-password {
    color: var(--content-link-color);
    text-decoration: none;
    transition: var(--transition-base);
}

.forgot-password:hover {
    color: var(--content-link-hover);
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-l);
    border-top: 1px solid var(--content-border-color);
}

.auth-footer p {
    color: var(--text-secondary-color);
    font-size: var(--font-size-base);
    margin: 0;
}

.auth-footer a {
    color: var(--content-link-color);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
}

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

/* Alert Messages */
.alert {
    padding: var(--spacing-m);
    border-radius: var(--radius-m);
    margin-bottom: var(--spacing-l);
    font-size: var(--font-size-base);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-s);
}

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

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

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

.alert-icon {
    flex-shrink: 0;
    font-size: var(--font-size-xl);
}

.alert-content {
    flex: 1;
}

/* Profile Page Specific Styles */
#profile-page-container {
    width: 100%;
    margin: 0 auto;
    max-width: 600px;
}

.profile-section {
    margin-bottom: var(--spacing-2xl);
}

.profile-section h2 {
    color: var(--content-primary-color);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-l);
    padding-bottom: var(--spacing-s);
    border-bottom: 2px solid var(--content-border-color);
}

.profile-info {
    background-color: var(--grey3-color);
    padding: var(--spacing-l);
    border-radius: var(--radius-m);
    margin-bottom: var(--spacing-l);
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-s) 0;
    border-bottom: 1px solid var(--content-border-color);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    color: var(--text-secondary-color);
    font-weight: var(--font-weight-medium);
}

.profile-info-value {
    color: var(--text-color);
    font-weight: var(--font-weight-normal);
}

.profile-actions {
    display: flex;
    gap: var(--spacing-m);
    margin-top: var(--spacing-l);
}

.profile-actions button {
    flex: 1;
}

/* Password Requirements */
.password-requirements {
    background-color: var(--grey3-color);
    padding: var(--spacing-m);
    border-radius: var(--radius-m);
    margin-top: var(--spacing-s);
    font-size: var(--font-size-s);
}

.password-requirements ul {
    margin: var(--spacing-s) 0 0 0;
    padding-left: var(--spacing-l);
    color: var(--text-secondary-color);
}

.password-requirements li {
    margin: var(--spacing-xs) 0;
}

/* Loading State */
.auth-button.loading {
    position: relative;
    color: transparent;
}

.auth-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spinner 0.6s linear infinite;
}

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

/* Responsive Design */
@media screen and (max-width: 1000px) {
    .auth-container {
        /* padding: var(--spacing-s); */
        padding: 0px;
    }

    .auth-card {
        width: auto;
        padding: var(--spacing-xl);
    }

    .auth-header h1 {
        font-size: var(--font-size-2xl);
    }

    .profile-actions {
        flex-direction: column;
    }

    .profile-info-item {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}
