/* Archive Encrypt / Decrypt — page-specific styles.
   Builds on common.css / files.css conventions (73hi theme). */

.ae-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.ae-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 12px;
    border-radius: 12px;
    border: 2px solid #d7dfeb;
    background: #fff;
    color: #44506a;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

.ae-mode-btn i { color: #8a94a8; }
.ae-mode-btn.is-active {
    border-color: #ff4d4d;
    background: #fff5f5;
    color: #c53030;
}
.ae-mode-btn.is-active i { color: #ff4d4d; }

.ae-card {
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 32, 60, 0.06);
}

.ae-card h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #1d3a6e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ae-card h2 i { color: #ff4d4d; }

.ae-hint {
    color: #6b7688;
    font-size: 0.85rem;
    margin: 2px 0 12px;
}

.ae-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .ae-layout { grid-template-columns: 1fr; }
}

/* Dropzones ----------------------------------------------------------- */
.ae-dropzone {
    border: 2px dashed #c9d4e5;
    border-radius: 12px;
    padding: 26px 14px;
    text-align: center;
    color: #6b7688;
    cursor: pointer;
    background: #f8fafd;
    transition: 0.15s;
}
.ae-dropzone:hover,
.ae-dropzone.is-drag {
    border-color: #ff4d4d;
    background: #fff5f5;
}
.ae-dropzone i {
    font-size: 1.7rem;
    color: #ff4d4d;
    display: block;
    margin-bottom: 8px;
}
.ae-dropzone strong {
    display: block;
    color: #1c2330;
    margin-bottom: 4px;
}

/* File rows ----------------------------------------------------------- */
.ae-file-count {
    color: #1d3a6e;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.ae-file-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #e3e8f0;
    border-radius: 9px;
    margin-bottom: 7px;
    background: #fafbfe;
    font-size: 0.88rem;
    min-width: 0;
}

.ae-file-row i { color: #8a94a8; flex-shrink: 0; }

.ae-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1c2330;
}

.ae-file-size {
    color: #6b7688;
    font-size: 0.78rem;
    white-space: nowrap;
}

.ae-remove {
    border: none;
    background: none;
    color: #b3bcca;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.9rem;
}
.ae-remove:hover { color: #ff4d4d; }

.ae-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ff4d4d;
    border-radius: 7px;
    background: #fff;
    color: #e11d48;
    padding: 5px 11px;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.ae-download-btn:hover { background: #fff5f5; }

.ae-empty {
    color: #6b7688;
    text-align: center;
    padding: 16px 0;
    font-size: 0.9rem;
    margin: 0;
}

/* Fields --------------------------------------------------------------- */
.ae-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

.ae-field > span {
    font-size: 0.8rem;
    color: #6b7688;
}

.ae-field input[type="text"],
.ae-field input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #d7dfeb;
    border-radius: 9px;
    font-size: 0.95rem;
    width: 100%;
    background: #fff;
    color: #1c2330;
}

.ae-field input:focus {
    outline: 2px solid rgba(255, 77, 77, 0.25);
    border-color: #ff4d4d;
}

.ae-password-wrap {
    position: relative;
}

.ae-password-wrap button {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #8a94a8;
    cursor: pointer;
    padding: 6px;
}

.ae-format-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

@media (max-width: 560px) {
    .ae-format-group { grid-template-columns: 1fr; }
}

.ae-format-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 2px solid #d7dfeb;
    border-radius: 11px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    transition: 0.15s;
}

.ae-format-option:has(input:checked) {
    border-color: #ff4d4d;
    background: #fff5f5;
}

.ae-format-option input {
    margin-top: 3px;
    accent-color: #ff4d4d;
}

.ae-format-option strong {
    display: block;
    color: #1c2330;
    font-size: 0.92rem;
}

.ae-format-option small {
    color: #6b7688;
    font-size: 0.76rem;
    line-height: 1.35;
    display: block;
    margin-top: 2px;
}

.ae-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 10px 0;
    font-size: 0.9rem;
    cursor: pointer;
    color: #44506a;
}

.ae-check input { accent-color: #ff4d4d; width: 16px; height: 16px; }

/* Strength meter -------------------------------------------------------- */
.ae-meter {
    height: 6px;
    border-radius: 999px;
    background: #eef1f6;
    overflow: hidden;
    margin-top: 6px;
}

.ae-meter::before {
    content: "";
    display: block;
    height: 100%;
    width: var(--w, 0%);
    background: var(--c, transparent);
    transition: width 0.2s, background 0.2s;
}

.ae-meter[data-strength="0"]::before { width: 0%; }
.ae-meter[data-strength="1"]::before { width: 25%; background: #f87171; }
.ae-meter[data-strength="2"]::before { width: 50%; background: #fbbf24; }
.ae-meter[data-strength="3"]::before { width: 75%; background: #34d399; }
.ae-meter[data-strength="4"]::before { width: 100%; background: #16a34a; }

/* Buttons ---------------------------------------------------------------- */
.ae-main-btn {
    width: 100%;
    padding: 13px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(120deg, #ff4d4d, #e11d48);
    border: none;
    border-radius: 11px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.ae-main-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ae-main-btn:hover:not(:disabled) { filter: brightness(1.05); }

.ae-secondary-btn {
    width: 100%;
    padding: 11px;
    border: 1px solid #1d3a6e;
    border-radius: 10px;
    background: #fff;
    color: #1d3a6e;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.ae-secondary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ae-secondary-btn:hover:not(:disabled) { background: #f0f5ff; }

/* Log & progress ---------------------------------------------------------- */
.ae-log {
    max-height: 150px;
    overflow-y: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.74rem;
    background: #f8fafd;
    border: 1px solid #e3e8f0;
    color: #44506a;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.ae-log .ok { color: #16a34a; }
.ae-log .err { color: #dc2626; }

.ae-progress-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ae-progress-track {
    flex: 1;
    height: 9px;
    background: #eef1f6;
    border-radius: 999px;
    overflow: hidden;
}

.ae-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4d4d, #f59e0b);
    transition: width 0.2s;
}

.ae-progress-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1d3a6e;
    min-width: 40px;
    text-align: right;
}

/* Toast -------------------------------------------------------------------- */
.ae-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    background: #1c2330;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.88rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 999;
    max-width: min(90vw, 560px);
    text-align: center;
}

.ae-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.ae-toast.is-error { background: #7f1d1d; }

/* Notices -------------------------------------------------------------------- */
.ae-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f0f5ff;
    border: 1px solid #c8d9ff;
    border-radius: 10px;
    padding: 11px 13px;
    color: #33507e;
    font-size: 0.85rem;
    margin: 0 0 14px;
}

.ae-note i { margin-top: 3px; }

.ae-note.warn {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #78350f;
}

/* Mobile touch targets: keep buttons comfortably large ------------------------ */
@media (pointer: coarse) {
    .ae-main-btn,
    .ae-mode-btn,
    .ae-secondary-btn,
    .ae-download-btn,
    .ae-field input {
        min-height: 46px;
    }
    .ae-download-btn { padding: 9px 14px; }
}
