/* Authentication Pages Styles */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 100%;            /* Allow full-width on mobile */
    display: flex;
    flex-direction: column;
    align-items: stretch;       /* Stretch children to container width (prevents text from defining width) */
    gap: 1.5rem;
    min-width: 0;               /* Fix flex min-content overflow */
}

.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-primary);
}

.auth-logo img {
    height: 60px;
    width: auto;
    margin-bottom: 0.5rem;
    max-width: 100%;
}

.auth-logo span {
    font-size: 1.25rem;
    font-weight: 600;
}

.auth-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    width: 100%;
    max-width: 100%;            /* Prevent content from setting card width */
    min-width: 0;
    overflow-wrap: anywhere;    /* Break long words/URLs */
    word-break: break-word;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0; /* Avoid long labels pushing width */
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%; /* Ensure inputs fill the form */
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-primary);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    text-decoration: none;
    color: white;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-block {
    width: 100%;
}

.auth-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.auth-links a {
    color: var(--color-primary);
    text-decoration: none;
    overflow-wrap: anywhere; /* Avoid long URLs causing overflow */
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
}

.auth-divider::before {
    margin-right: 1rem;
}

.auth-divider::after {
    margin-left: 1rem;
}

.external-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-external {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
    width: 100%;
}

.btn-external:hover {
    background-color: var(--color-border);
    text-decoration: none;
}

.btn-external i {
    font-size: 1.25rem;
}

.validation-summary-errors {
    color: var(--color-error);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.validation-summary-errors ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.field-validation-error {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.input-validation-error {
    border-color: var(--color-error);
}

.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-footer {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Status message */
.status-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.status-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.status-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.status-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
}

/* Wider layout on larger screens */
@media (min-width: 640px) {
    .auth-container {
        max-width: 600px;      /* Bring back a pleasant max width on tablets+ */
        margin: 0 auto;
    }
}
