/* =============================================
   register.css
   Register-specific styles — extends login.css
   PT Graha Prima Sukses Mandiri
============================================= */

/* =============================================
   FORM PANEL OVERRIDE FOR REGISTER
   (more fields = taller panel, needs scroll)
============================================= */
body {
    overflow: auto;
}

/* Convert panel to scrollable column — no longer fixed-height centered */
.form-panel {
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    /* Remove position:relative so absolute footer from login.css is scoped here */
    position: relative;
}

.form-card {
    width: 100%;
    max-width: 360px;
    /* No fixed padding — let content breathe naturally */
}

/* ---- Override absolute footer → in-flow for register ---- */
.form-footer {
    position: static;           /* cancel absolute from login.css */
    margin-top: 2rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    width: 100%;
    max-width: 360px;
    padding-bottom: 0.5rem;
}

/* Tighten field spacing slightly to fit more fields */
.field-group {
    margin-bottom: 0.9rem;
}

/* =============================================
   PASSWORD STRENGTH INDICATOR
============================================= */
.pw-strength {
    height: 3px;
    background: var(--border);
    border-radius: 100px;
    margin-top: 6px;
    overflow: hidden;
}

.pw-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 100px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.pw-strength-bar.weak   { background: #e74c3c; width: 30%; }
.pw-strength-bar.medium { background: #f39c12; width: 65%; }
.pw-strength-bar.strong { background: #27ae60; width: 100%; }

.pw-strength-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 4px;
    min-height: 1em;
    transition: color 0.3s ease;
}

.pw-strength-label.weak   { color: #e74c3c; }
.pw-strength-label.medium { color: #f39c12; }
.pw-strength-label.strong { color: #27ae60; }

/* =============================================
   PASSWORD MATCH ICON
============================================= */
.pw-match-icon {
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* =============================================
   ROLE SELECTOR CARDS
============================================= */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;  
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 1rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    overflow: hidden;
}

/* Hide native radio */
.role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Hover state */
.role-card:hover {
    border-color: var(--brand-mid);
    background: var(--brand-pale);
}

/* Selected state */
.role-card.is-selected {
    border-color: var(--brand-mid);
    background: var(--brand-pale);
    box-shadow: 0 0 0 3px rgba(26, 116, 196, 0.12);
}

/* Subtle shimmer on selection */
.role-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 116, 196, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.role-card.is-selected::before {
    opacity: 1;
}

/* Icon container */
.role-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.role-card-icon svg {
    width: 20px;
    height: 20px;
}

.role-card.is-selected .role-card-icon {
    background: var(--brand-mid);
    color: #ffffff;
}

.role-card-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.role-card-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Checkmark badge (top-right corner) */
.role-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.role-card-check svg {
    width: 11px;
    height: 11px;
    color: #ffffff;
}

.role-card.is-selected .role-card-check {
    opacity: 1;
    transform: scale(1);
}

/* Focus-visible for keyboard navigation */
.role-card:focus-within {
    outline: 2px solid var(--brand-mid);
    outline-offset: 2px;
}

/* =============================================
   ANIMATIONS — stagger for extra fields
============================================= */
.field-group:nth-child(3) { animation: slideUp 0.5s 0.30s ease both; }
.field-group:nth-child(4) { animation: slideUp 0.5s 0.36s ease both; }
.field-group:nth-child(5) { animation: slideUp 0.5s 0.42s ease both; }
.field-group:nth-child(6) { animation: slideUp 0.5s 0.48s ease both; }

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 860px) {
    .form-panel {
        align-items: flex-start;
    }
}

@media (max-width: 400px) {
    .role-selector {
        grid-template-columns: 1fr;
    }
}