/**
 * CDA Auth Styles
 */

/* Ensure header stays fixed to top */
#head {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Container */
.cda-auth-container {
    max-width: 480px;
    margin: 2em auto;
    padding: 2em;
}

.cda-auth-container h1 {
    margin-bottom: 1em;
    text-align: center;
}

/* Sections */
.cda-auth-section {
    margin-bottom: 2em;
}

.cda-auth-section h2 {
    font-size: 1.1em;
    margin-bottom: 0.5em;
}

.cda-auth-section p {
    margin-bottom: 1em;
    opacity: 0.8;
    font-size: 0.9em;
}

/* Divider */
.cda-auth-divider {
    display: flex;
    align-items: center;
    margin: 2em 0;
}

.cda-auth-divider::before,
.cda-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.lights-on .cda-auth-divider::before,
.lights-on .cda-auth-divider::after {
    background: rgba(0, 0, 0, 0.2);
}

.cda-auth-divider span {
    padding: 0 1em;
    font-size: 0.85em;
    opacity: 0.6;
}

/* Form */
.cda-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cda-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.cda-auth-field label {
    font-size: 0.9em;
    font-weight: 500;
}

.cda-auth-field input[type="text"],
.cda-auth-field input[type="email"],
.cda-auth-field input[type="password"] {
    padding: 0.8em 1em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-size: 1em;
    transition: border-color 0.2s, background 0.2s;
}

.cda-auth-field input:focus {
    border-color: #f86a22;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.lights-on .cda-auth-field input[type="text"],
.lights-on .cda-auth-field input[type="email"],
.lights-on .cda-auth-field input[type="password"] {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.03);
}

.lights-on .cda-auth-field input:focus {
    background: rgba(0, 0, 0, 0.05);
}

.cda-auth-hint {
    font-size: 0.8em;
    opacity: 0.6;
}

.cda-auth-checkbox {
    flex-direction: row;
    align-items: center;
}

.cda-auth-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
}

.cda-auth-checkbox input[type="checkbox"] {
    width: auto;
    display: inline-block;
}

/* Buttons */
.cda-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 1em 2em;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.1s;
}

/* Full width buttons in forms */
.cda-auth-form .cda-auth-btn {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure inputs are also box-sizing border-box */
.cda-auth-field input {
    box-sizing: border-box;
    width: 100%;
}

.cda-auth-btn:active {
    opacity: 0.9;
}

.cda-auth-btn-primary {
    background: #f86a22;
    color: #fff;
}

.cda-auth-btn-primary:hover {
    background: #e55a12;
}

.cda-auth-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.cda-auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lights-on .cda-auth-btn-secondary {
    background: rgba(0, 0, 0, 0.1);
}

.lights-on .cda-auth-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.15);
}

.cda-auth-btn-forum {
    background: #4a90d9;
    color: #fff;
}

.cda-auth-btn-forum:hover {
    background: #3a80c9;
}

.cda-auth-btn-forum svg {
    flex-shrink: 0;
}

/* Small button variant */
.cda-auth-btn-small {
    padding: 0.6em 1.2em;
    font-size: 0.85em;
}

/* Alternative section (less prominent) */
.cda-auth-section-alt {
    text-align: center;
    opacity: 0.8;
}

.cda-auth-alt-text {
    font-size: 0.85em;
    margin-bottom: 0.8em;
    opacity: 0.7;
}

/* Messages */
.cda-auth-message {
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1em;
}

.cda-auth-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b7a;
}

.cda-auth-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #5cdb7a;
}

.lights-on .cda-auth-error {
    color: #dc3545;
}

.lights-on .cda-auth-success {
    color: #28a745;
}

/* Notice */
.cda-auth-notice {
    padding: 1em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.9em;
}

.cda-auth-notice a {
    color: #f86a22;
}

.lights-on .cda-auth-notice {
    background: rgba(0, 0, 0, 0.05);
}

/* Links */
.cda-auth-links {
    text-align: center;
    margin-top: 2em;
    font-size: 0.9em;
}

.cda-auth-links a {
    color: #f86a22;
}

/* Profile specific */
.cda-auth-profile {
    max-width: 600px;
}

.cda-profile-header {
    display: flex;
    gap: 1.5em;
    margin-bottom: 2em;
    padding-bottom: 2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lights-on .cda-profile-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.cda-profile-avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.cda-profile-info h2 {
    text-align: left;
    margin-bottom: 0.3em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 1.5em;
}

.cda-profile-email {
    opacity: 0.7;
    font-size: 0.9em;
    margin-bottom: 0.5em;
}

.cda-profile-forum-link a {
    color: #4a90d9;
    font-size: 0.9em;
}

/* Profile sections */
.cda-profile-section {
    padding: 1.5em 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cda-profile-section:last-child {
    border-bottom: none;
}

.lights-on .cda-profile-section {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.cda-profile-section h2 {
    font-size: 1.1em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lights-on .cda-profile-section h2 {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Profile form improvements */
.cda-auth-profile .cda-auth-form {
    gap: 1.2em;
}

.cda-auth-profile .cda-auth-notice {
    margin-top: 0.5em;
}

/* Profile comments */
.cda-profile-comments {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.cda-profile-comment {
    padding: 0.875em 1em;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.cda-profile-comment:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #f86a22;
}

.lights-on .cda-profile-comment {
    background: rgba(0, 0, 0, 0.02);
}

.lights-on .cda-profile-comment:hover {
    background: rgba(0, 0, 0, 0.04);
}

.cda-profile-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4em;
    gap: 0.75em;
}

.cda-profile-comment-post {
    color: #f86a22;
    font-weight: 500;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.cda-profile-comment-date {
    opacity: 0.45;
    font-size: 0.7em;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.cda-profile-comment-content {
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Forum Badge */
.cda-forum-badge,
.cda-forum-badge-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4a90d9;
    margin-left: 0.3em;
    vertical-align: middle;
}

.cda-forum-badge {
    cursor: help;
}

.cda-forum-badge-link {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.cda-forum-badge-link:hover {
    color: #3a7bc8;
}

.cda-forum-badge svg,
.cda-forum-badge-link svg {
    width: 14px;
    height: 14px;
}

.cda-profile-info .cda-forum-badge svg,
.cda-profile-info .cda-forum-badge-link svg {
    width: 24px;
    height: 24px;
}

.cda-profile-info .cda-forum-badge,
.cda-profile-info .cda-forum-badge-link {
    display: inline;
    margin-left: 0.2em;
    vertical-align: middle;
}

.cda-profile-info .cda-forum-badge-link svg {
    vertical-align: -0.15em;
}

/* Responsive */
@media (max-width: 600px) {
    .cda-auth-container {
        margin: 1em;
        padding: 1.5em;
    }

    .cda-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cda-profile-info h2 {
        justify-content: center;
    }

    .cda-profile-comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2em;
    }

    .cda-profile-comment-post {
        white-space: normal;
    }
}
