/* ================================================================
 * Authorization Query Element — Frontend Styles
 * Structural CSS + modal + certificate detail card
 * Dynamic values (colors, sizes) are auto-generated by Bricks.
 * CSS variables (--aq-accent, --aq-input-border)
 * are set inline by the element's render() method.
 * ================================================================ */

/* ─── Wrapper ──────────────────────────────────────────── */

.lithtech-auth-query-wrapper {
    width: 100%;
}

/* ─── Description (above container) ────────────────────── */

.lithtech-aq-desc {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.6;
    /* color, font-size controlled by Bricks */
}

/* ─── Container ────────────────────────────────────────── */

.lithtech-aq-container {
    margin: 0 auto;
    text-align: center;
    /* bg, padding, radius, max-width, shadow controlled by Bricks */
}

/* ─── Title ────────────────────────────────────────────── */

.lithtech-aq-title {
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 24px 0;
    /* color, font-size controlled by Bricks */
}

/* ─── Form ─────────────────────────────────────────────── */

.lithtech-aq-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ─── Input Wrapper ────────────────────────────────────── */

.lithtech-aq-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--aq-input-border, #e5e5e5);
    padding: 0 16px;
    transition: border-color 0.2s ease;
    /* bg, radius controlled by Bricks */
}

.lithtech-aq-input-wrap:focus-within {
    border-color: var(--aq-accent, #E01E1E);
}

/* ─── Shield Icon ──────────────────────────────────────── */

.lithtech-aq-icon {
    flex-shrink: 0;
    margin-right: 8px;
    color: var(--aq-accent, #E01E1E);
}

/* ─── Text Input ───────────────────────────────────────── */

.lithtech-aq-input,
.lithtech-aq-input-wrap input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14px;
    color: #333;
    min-width: 0;
}

.lithtech-aq-input::placeholder,
.lithtech-aq-input-wrap input[type="text"]::placeholder {
    color: #bbb;
}

/* ─── Buttons ──────────────────────────────────────────── */

.lithtech-aq-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.lithtech-aq-btn {
    border: none;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    /* bg, text color, radius controlled by Bricks */
}

.lithtech-aq-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.lithtech-aq-btn:active {
    transform: translateY(0);
}

.lithtech-aq-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.lithtech-aq-btn-reset {
    opacity: 0.85;
}

.lithtech-aq-btn-reset:hover {
    opacity: 0.7;
}

/* ─── Status / Loading ─────────────────────────────────── */

.lithtech-aq-status {
    margin-top: 16px;
    font-size: 14px;
    min-height: 20px;
}

.lithtech-aq-status.loading {
    color: #999;
}

.lithtech-aq-status.error {
    color: #d32f2f;
}

.lithtech-aq-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--aq-accent, #E01E1E);
    border-radius: 50%;
    animation: lithtech-aq-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ================================================================
 * MODAL OVERLAY
 * ================================================================ */

.lithtech-aq-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.lithtech-aq-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── Modal Dialog ─────────────────────────────────────── */

.lithtech-aq-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.lithtech-aq-overlay.active .lithtech-aq-modal {
    transform: translateY(0) scale(1);
}

/* ─── Modal Close Button ───────────────────────────────── */

.lithtech-aq-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: background 0.2s, color 0.2s;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lithtech-aq-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
}

/* ─── Modal Header ─────────────────────────────────────── */

.lithtech-aq-modal-header {
    padding: 24px 28px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.lithtech-aq-modal-logo {
    max-width: 80px;
    max-height: 80px;
    margin: 0 auto 12px;
    display: block;
    border-radius: 8px;
}

.lithtech-aq-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.lithtech-aq-modal-subtitle {
    font-size: 14px;
    color: #999;
    margin: 4px 0 0;
}

/* ─── Status Badge ─────────────────────────────────────── */

.lithtech-aq-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin: 16px auto 0;
}

.lithtech-aq-badge.valid {
    background: #e8f5e9;
    color: #2e7d32;
}

.lithtech-aq-badge.expired {
    background: #ffebee;
    color: #c62828;
}

.lithtech-aq-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.lithtech-aq-badge.valid::before {
    background: #4caf50;
}

.lithtech-aq-badge.expired::before {
    background: #f44336;
}

/* ─── Modal Body ───────────────────────────────────────── */

.lithtech-aq-modal-body {
    padding: 20px 28px 28px;
}

/* ─── Detail Table ─────────────────────────────────────── */

.lithtech-aq-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.lithtech-aq-detail-table th {
    text-align: left;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    width: 40%;
    vertical-align: top;
    border-bottom: 1px solid #f5f5f5;
}

.lithtech-aq-detail-table td {
    padding: 10px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    text-align: right;
}

.lithtech-aq-detail-table tr:last-child th,
.lithtech-aq-detail-table tr:last-child td {
    border-bottom: none;
}

/* ─── Certificate Image ────────────────────────────────── */

.lithtech-aq-cert-image {
    width: 100%;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #eee;
}

/* ─── Not Found Message ────────────────────────────────── */

.lithtech-aq-modal-message {
    text-align: center;
    padding: 40px 28px;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.lithtech-aq-modal-message-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

/* ─── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
    .lithtech-aq-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .lithtech-aq-btn {
        width: 100%;
        text-align: center;
    }

    .lithtech-aq-detail-table th {
        width: 45%;
    }

    .lithtech-aq-modal {
        border-radius: 12px;
    }

    .lithtech-aq-modal-header,
    .lithtech-aq-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}