/* Auth Modal */
.rp-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rp-auth-modal.open {
    opacity: 1;
    visibility: visible;
}

.rp-auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.rp-auth-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rp-auth-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.rp-auth-close {
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.25rem;
}

.rp-auth-close:hover {
    color: var(--text-primary);
}

.rp-auth-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.rp-auth-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.rp-auth-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rp-auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rp-auth-field {
    margin-bottom: 1.25rem;
}

.rp-auth-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rp-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rp-auth-error {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 1.25rem;
}

.rp-auth-submit {
    width: 100%;
    justify-content: center;
}

/* Role Selection */
.rp-role-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rp-role-button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.rp-role-button i {
    font-size: 2rem;
}

.rp-role-button:hover, .rp-role-button.selected {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.rp-auth-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
}

/* Loader */
.rp-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

/* Signature Canvas */
.rp-signature-wrap {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: white; /* Signature needs contrast if ink is black */
    position: relative;
    height: 150px;
}

#rp-signature-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#rp-signature-clear {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
