/* Frontend CSS — Artepoli Protected Library */

.apl-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Form */
.apl-form-wrap {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
}

.apl-form .apl-field {
    margin-bottom: 18px;
}

.apl-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.apl-form input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color .2s;
}

.apl-form input[type="email"]:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .08);
}

.apl-checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    cursor: pointer;
}

.apl-checkbox-field input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Buttons */
.apl-btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
    line-height: 1.4;
}

.apl-btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.apl-btn-primary:hover {
    background: #333;
    color: #fff;
    transform: translateY(-1px);
}

.apl-btn-download {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
}

.apl-btn-download:hover {
    background: #333;
    color: #fff;
}

/* Messages */
.apl-message {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.apl-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.apl-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Library header */
.apl-library-header {
    text-align: right;
    margin-bottom: 16px;
}

.apl-user-info {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.apl-logout-link {
    color: #6b7280;
    text-decoration: underline;
}

.apl-logout-link:hover {
    color: #1a1a1a;
}

/* Flat file list */
.apl-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apl-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
}

.apl-file-info {
    flex: 1;
    min-width: 0;
}

.apl-file-title {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apl-file-tag {
    display: inline-block;
    background: #e5e7eb;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.apl-file-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.apl-file-actions {
    flex-shrink: 0;
}

.apl-no-files {
    color: #6b7280;
    font-style: italic;
}

/* Grouped / folder view */
.apl-library-grouped {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.apl-folder {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.apl-folder-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
}

.apl-folder-icon {
    font-size: 18px;
}

.apl-folder-name {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
    flex: 1;
}

.apl-folder-count {
    background: #e5e7eb;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.apl-file-list--indented {
    padding: 12px 16px;
    gap: 8px;
    background: #fff;
}

.apl-file-list--indented .apl-file-item {
    background: #fff;
    border-color: #f0f0f0;
    padding: 12px 16px;
}

/* Pending */
.apl-pending-wrap .apl-message {
    font-size: 15px;
}

.apl-pending-wrap p {
    font-size: 13px;
    color: #6b7280;
    margin-top: 12px;
}

.apl-pending-wrap a {
    color: #1a1a1a;
}