/**
 * Selection Studio — Add Page Resident CSS (Unified Phase 4 Overlay Constitution)
 * Location: /studio/css/add-page.css
 */

.add-page-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: transparent;
}

.add-page-container {
    position: relative;
    padding: var(--space-6, 2rem);
    max-width: 580px;
    margin: 0 auto;
    color: var(--studio-text-primary);
    font-family: var(--studio-font-sans);
}

.add-page-header {
    margin-bottom: var(--space-6, 2rem);
}

.add-page-header h2 {
    font-size: var(--studio-type-dialog-title-size);
    font-weight: var(--studio-font-weight-medium);
    line-height: var(--studio-type-dialog-title-line-height);
    letter-spacing: var(--studio-type-dialog-title-letter-spacing);
    color: var(--studio-text-primary);
    margin: 0 0 var(--space-2, 0.5rem);
}

.add-page-header p {
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    color: var(--studio-text-muted);
    margin: 0;
}

.form-group {
    margin-bottom: var(--space-5, 1.5rem);
}

.form-group label {
    display: block;
    font-size: var(--studio-type-field-label-size);
    font-weight: var(--studio-font-weight-medium);
    line-height: var(--studio-type-field-label-line-height);
    color: var(--studio-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--studio-type-field-label-letter-spacing);
    margin-bottom: var(--space-3, 0.75rem);
}

.studio-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4, 1rem);
    background: var(--color-bg-input, rgba(6, 9, 12, 0.8));
    border: 1px solid var(--border-panel, #1b2a38);
    border-radius: var(--radius-medium, 6px);
    color: var(--studio-text-primary);
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    outline: none;
    transition: border-color var(--motion-fast, 160ms) ease, box-shadow var(--motion-fast, 160ms) ease;
}

.studio-input:focus {
    border-color: var(--studio-gold, #d4b483);
    box-shadow: 0 0 0 3px rgba(212, 180, 131, 0.15);
}

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4, 1rem);
}

/* =========================================================
   CANONICAL CARD CONSTITUTION (HUB ALIGNMENT)
   ========================================================= */

.mode-card {
    appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;

    background: rgba(6, 9, 12, 0.5);
    border: 1px solid var(--color-border-default, #1b2a38);
    border-radius: var(--radius-large, 12px);
    padding: var(--space-4, 1rem);
    text-align: left;
    cursor: pointer;

    transition:
        transform var(--motion-normal, 200ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
        border-color var(--motion-normal, 200ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
        background-color var(--motion-normal, 200ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1)),
        box-shadow var(--motion-normal, 200ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1));
}

.mode-card:hover:not(.disabled) {
    transform: translateY(-2px);
    border-color: var(--color-border-strong, #3a4d5e);
    background-color: rgba(255, 255, 255, .04);
    box-shadow: var(--shadow-small, 0 2px 8px rgba(0, 0, 0, 0.2));
}

.mode-card.active {
    border-color: var(--color-accent-border, #d4b483);
    background: linear-gradient(145deg,
            rgba(212, 180, 131, 0.11),
            rgba(212, 180, 131, 0.035));
    box-shadow: var(--shadow-small, 0 2px 8px rgba(0, 0, 0, 0.2));
}

.mode-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mode-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.mode-title {
    font-size: var(--studio-type-card-title-size);
    font-weight: var(--studio-font-weight-strong);
    line-height: var(--studio-type-card-title-line-height);
    color: var(--studio-text-primary);
}

.mode-desc {
    font-size: var(--studio-type-meta-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-meta-line-height);
    color: var(--studio-text-muted);
    margin-top: 0.2rem;
}

.add-page-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: var(--studio-text-danger);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    margin-bottom: 1.5rem;
}

.add-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3, 0.75rem);
    margin-top: var(--space-6, 2rem);
}

.btn-studio {
    font-size: var(--studio-type-ui-label-size);
    font-weight: var(--studio-font-weight-strong);
    line-height: 1;
    cursor: pointer;
}

.btn-studio.secondary {
    appearance: none;
    height: 32px;
    min-height: 32px;
    padding: 0 14px;
    border: none;
    outline: none;
    border-radius: 6px;
    background: transparent;
    color: var(--studio-text-muted);
    font-weight: var(--studio-font-weight-medium);
    line-height: 1;
    transition: background-color 160ms ease, color 160ms ease;
}

.btn-studio.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.btn-studio.primary {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--studio-gold, #d4b483);
    border-radius: 6px;
    background: rgba(212, 180, 131, 0.08);
    color: var(--studio-text-accent);
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, opacity 160ms ease;
}

.btn-studio.primary .resident-action-arrow {
    display: inline-block;
    transition: transform 180ms ease;
}

.btn-studio.primary:hover:not(:disabled) {
    background: var(--studio-gold, #d4b483);
    color: #06090c;
    box-shadow: 0 0 12px rgba(212, 180, 131, 0.25);
}

.btn-studio.primary:hover:not(:disabled) .resident-action-arrow {
    transform: translateX(4px);
}

.btn-studio.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-studio.primary:focus-visible,
.btn-studio.secondary:focus-visible {
    outline: 2px solid var(--studio-gold, #d4b483);
    outline-offset: 2px;
}

.add-page-close-btn {
    appearance: none;
    position: absolute;
    top: var(--space-6, 2rem);
    right: var(--space-6, 2rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--studio-text-muted);
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 2;
    transition: color 160ms ease, background-color 160ms ease;
}

.add-page-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.add-page-close-btn:focus-visible {
    outline: 2px solid var(--studio-gold, #d4b483);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mode-card:hover:not(.disabled) {
        transform: none;
    }

    .btn-studio.primary:hover:not(:disabled) .resident-action-arrow {
        transform: translateX(0);
    }
}
