/* ==========================================================================
   Auto-Atia popup — styles for the modal injected at runtime by atia.js
   All classes are namespaced with "axm-atia-" to avoid collisions with the
   rest of the site's CSS. Reuses the same color/font variables login.css
   relies on (defined in header.css's :root block); falls back to sane
   defaults if that file isn't loaded first.
   ========================================================================== */

.axm-atia-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.axm-atia-overlay.active {
    opacity: 1;
    visibility: visible;
}

.axm-atia-modal {
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
	padding: 12px;
    overflow-y: auto;
    background: var(--bg-dark-5, #1c1812);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(14px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Changa', sans-serif;
}

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

/* ---- Header ---- */

.axm-atia-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.axm-atia-header-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}




.axm-atia-header-icon {
    width: 40px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.9));
}

.axm-atia-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white, #fff);
    margin: 0;
}

.axm-atia-title span {
    background: linear-gradient(45deg, var(--primary-accent-light, #FA8072), var(--primary-accent-dark, #DC143C));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.axm-atia-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark, #888);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.axm-atia-close:hover {
    background: rgba(235, 74, 87, 0.15);
    color: var(--primary-accent, #EB4A57);
    transform: rotate(90deg);
}

/* ---- Body ---- */

.axm-atia-body {
    padding: 14px 16px 16px;
}

.axm-atia-blurb {
    font-size: 12px;
    color: var(--text-dark, #888);
    line-height: 1.4;
	text-align: center;
    margin: 0 0 12px;
}

.axm-atia-loading {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-dark, #888);
    padding: 12px 0;
}

.axm-atia-empty {
    display: none;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-dark, #888);
    padding: 12px 0;
}

/* ---- Address list ---- */

.axm-atia-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.axm-atia-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-dark-4);
    border-radius: 10px;
}

.axm-atia-row-self {
    background: var(--bg-dark-4);
}

.axm-atia-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.axm-atia-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.axm-atia-row-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-white, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.axm-atia-row-address {
    font-size: 10.5px;
    font-family: monospace;
    color: var(--text-dark, #888);
}

.axm-atia-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-accent-light, #FA8072);
    background: rgba(235, 74, 87, 0.14);
    border: 1px solid rgba(235, 74, 87, 0.3);
    border-radius: 999px;
    padding: 2px 8px;
}

/* ---- Toggle switch ---- */

.axm-atia-toggle {
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.axm-atia-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.axm-atia-toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-color, #2e2820);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.axm-atia-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.axm-atia-toggle input:checked + .axm-atia-toggle-slider {
    background: linear-gradient(135deg, var(--primary-accent, #EB4A57), var(--primary-accent-dark, #DC143C));
    border-color: transparent;
}

.axm-atia-toggle input:checked + .axm-atia-toggle-slider::before {
    transform: translateX(14px);
}

/* ---- Remove button ---- */

.axm-atia-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(235, 74, 87, 0.08);
    border: 1px solid rgba(235, 74, 87, 0.2);
    color: var(--primary-accent-light, #FA8072);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.axm-atia-remove:hover {
    background: rgba(235, 74, 87, 0.18);
    border-color: rgba(235, 74, 87, 0.4);
}

/* ---- Add address form ---- */

.axm-atia-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.axm-atia-input {
    flex: 1 1 100%;
    padding: 8px 10px;
    background: var(--bg-dark-6, #0E0F16);
    border: 1px solid var(--border-color, #2e2820);
    border-radius: 8px;
    color: var(--text-white, #fff);
    font-size: 12.5px;
    font-family: 'Changa', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
    min-width: 0;
}

.axm-atia-input-label {
    flex: 1 1 auto;
}

.axm-atia-input:focus {
    border-color: var(--primary-accent, #EB4A57);
}

.axm-atia-input::placeholder {
    color: #555;
}

.axm-atia-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.axm-atia-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.axm-atia-btn-primary {
    background: linear-gradient(135deg, var(--primary-accent, #EB4A57), var(--primary-accent-dark, #DC143C));
    color: #fff;
}

.axm-atia-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(235, 74, 87, 0.4);
}

/* ---- Messages ---- */

.axm-atia-error {
    display: none;
    font-size: 11px;
    color: var(--primary-accent-light, #FA8072);
    background: rgba(235, 74, 87, 0.1);
    border: 1px solid rgba(235, 74, 87, 0.25);
    border-radius: 7px;
    padding: 6px 8px;
    margin-top: 10px;
    text-align: center;
}

.axm-atia-error.show {
    display: block;
}

.axm-atia-success {
    display: none;
    font-size: 11px;
    color: var(--secondary-accent, #35D07F);
    background: rgba(53, 208, 127, 0.1);
    border: 1px solid rgba(53, 208, 127, 0.25);
    border-radius: 7px;
    padding: 6px 8px;
    margin-top: 10px;
    text-align: center;
}

.axm-atia-success.show {
    display: block;
}

.axm-atia-logged-out {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 4px;
    text-align: center;
}

.axm-atia-blurb-center {
    text-align: center;
    padding: 0 6px;
}

@media (max-width: 480px) {
    .axm-atia-input {
        font-size: 12px;
    }
}

/* ==========================================================================
   Inline "add address" panel — expands in place below the address list
   inside the same modal (no second popup). Mode row (icon + label +
   toggle) mirrors the pattern used elsewhere on the site.
   ========================================================================== */

.axm-atia-add-panel {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    animation: axm-atia-panel-in 0.2s ease;
}

@keyframes axm-atia-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.axm-atia-mode-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-dark-4);

    border-radius: 12px;
}

.axm-atia-mode-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(235, 74, 87, 0.14);
    color: var(--primary-accent, #EB4A57);
    font-size: 13px;
}

.axm-atia-mode-label {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white, #fff);
}

.axm-atia-mode-desc {
    font-size: 11px;
    color: var(--text-dark, #888);
    line-height: 1.4;
    margin: 10px 2px 14px;
}

.axm-atia-bulk-fields {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.axm-atia-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark-6, #0E0F16);
    border: 1px solid var(--border-color, #2e2820);
    border-radius: 10px;
    color: var(--text-white, #fff);
    font-size: 12px;
    font-family: monospace;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    min-height: 96px;
    transition: border-color 0.2s ease;
}

.axm-atia-textarea:focus {
    border-color: var(--primary-accent, #EB4A57);
}

.axm-atia-textarea::placeholder {
    color: #555;
}

.axm-atia-import-summary {
    font-size: 11px;
    color: var(--text-dark, #888);
    text-align: center;
}

/* Full-width trigger/action button (opens the add popup, or submits inside
   it) — same gradient treatment as .axm-atia-btn-primary but stretched to
   the row's full width instead of sitting next to input fields. */
.axm-atia-add-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--primary-accent, #EB4A57), var(--primary-accent-dark, #DC143C));
    color: #fff;
}


.axm-atia-add-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Bordered, low-emphasis action — mirrors the "Close" button style from
   the reference popup: outline only, no fill, so it reads as secondary
   next to the gradient add/import button. */
.axm-atia-btn-outline {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(235, 74, 87, 0.3);
    border-radius: 10px;
    background: rgba(235, 74, 87, 0.06);
    color: var(--primary-accent-light, #FA8072);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    margin-top: 10px;
}
