/* ==========================================================================
   KB Learning — Guest Portal
   partner-registration.css  (Light design)
   ========================================================================== */

/* ---- Light Page: force header into its "scrolled" (white) state ---- */
body.light-page .site-header {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 12px rgba(0,0,0,0.07);
}

body.light-page .site-header .logo-dark  { display: none; }
body.light-page .site-header .logo-light { display: block; }

body.light-page .nav-link               { color: var(--gray-700); }
body.light-page .nav-link:hover         { color: var(--purple); background: var(--purple-light); }

body.light-page .btn-lang               { color: var(--gray-700); border-color: var(--gray-300); }
body.light-page .btn-lang:hover         { background: var(--gray-100); color: var(--purple); border-color: var(--purple); }

body.light-page .mobile-menu-btn span   { background: var(--gray-800); }

body.light-page .mobile-nav             { background: rgba(255,255,255,0.98); }
body.light-page .mobile-nav-link        { color: var(--gray-800); }
body.light-page .mobile-nav-link:hover  { color: var(--purple); }

/* ---- Page Layout ---- */
.reg-section {
    min-height: 100vh;
    padding: 48px 24px 80px;
    background: var(--gray-50);
    position: relative;
    overflow: hidden;
}

/* Subtle decorative blobs — very light */
.reg-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.reg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.07;
}

.reg-blob-1 {
    width: 500px; height: 500px;
    background: var(--purple);
    top: -160px; right: -100px;
}

.reg-blob-2 {
    width: 400px; height: 400px;
    background: var(--teal);
    bottom: -120px; left: -80px;
}

/* ---- Container ---- */
.reg-container {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

/* ---- Header ---- */
.reg-header { text-align: center; margin-bottom: 36px; }

.reg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color var(--transition);
}

.reg-back-link:hover { color: var(--purple); }

.reg-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.reg-subtitle {
    font-size: 16px;
    color: var(--gray-500);
}

/* ---- Step Progress ---- */
.reg-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.reg-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-400);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.reg-step.active .step-circle {
    background: var(--purple);
    border-color: var(--purple);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(136,82,248,0.35);
}

.reg-step.done .step-circle {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.step-label {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
    white-space: nowrap;
}

.reg-step.active .step-label { color: var(--purple); font-weight: 600; }
.reg-step.done .step-label   { color: var(--teal); }

.reg-step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 10px;
    margin-bottom: 22px;
    min-width: 40px;
    max-width: 120px;
}

/* ---- Card ---- */
.reg-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 600px) {
    .reg-card { padding: 24px 20px; }
    .reg-title { font-size: 24px; }
}

/* ---- Step Panels ---- */
.reg-step-panel { display: none; }

.reg-step-panel.active {
    display: block;
    animation: fadeSlide 0.25s ease;
}

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

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.step-hint {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ---- Form Elements ---- */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
}

.required-label::after {
    content: ' *';
    color: #ef4444;
}

.form-hint-top {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: -4px;
    margin-bottom: 12px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-900);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control::placeholder { color: var(--gray-400); }

.form-control:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(136,82,248,0.12);
}

.form-control.is-invalid { border-color: #ef4444; }

.field-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 5px;
}

.form-group { margin-bottom: 20px; }

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group-full { grid-column: 1 / -1; }

@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-group-full { grid-column: 1; }
}

/* ---- Type Cards Grid ---- */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

.type-card {
    cursor: pointer;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    transition: all 0.2s;
    display: block;
}

.type-card:hover {
    border-color: var(--purple);
    background: var(--purple-light);
}

.type-card:has(.type-radio:checked) {
    border-color: var(--purple);
    background: var(--purple-light);
    box-shadow: 0 0 0 3px rgba(136,82,248,0.15);
}

.type-card-other:has(.type-radio:checked) {
    border-color: var(--orange);
    background: #fff8f0;
    box-shadow: 0 0 0 3px rgba(255,138,38,0.15);
}

.type-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    text-align: center;
}

.type-card-icon {
    font-size: 22px;
    color: var(--purple);
}

.type-card-other .type-card-icon { color: var(--orange); }

.type-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.3;
}

/* ---- Category Counter ---- */
.cat-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--purple-light);
    border: 1px solid rgba(136,82,248,0.25);
    color: var(--purple);
    font-size: 14px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 14px;
}

.cat-counter.at-max {
    background: #fff3e0;
    border-color: rgba(255,138,38,0.4);
    color: var(--orange);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* ---- Category Tree ---- */
.cat-tree-wrapper {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.cat-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.cat-search i { color: var(--gray-400); font-size: 13px; }

.cat-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--gray-800);
    font-size: 14px;
    font-family: inherit;
}

.cat-search input::placeholder { color: var(--gray-400); }

.cat-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.cat-tree::-webkit-scrollbar { width: 5px; }
.cat-tree::-webkit-scrollbar-track { background: transparent; }
.cat-tree::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }

/* Tree Node */
.cat-node { user-select: none; }

.cat-node-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.cat-node-row:hover { background: var(--gray-100); }
.cat-node-row.selected { background: var(--purple-light); }
.cat-node-row.disabled { opacity: 0.4; cursor: not-allowed; }

.cat-toggle {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400);
    font-size: 10px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.cat-toggle:hover { background: var(--gray-200); color: var(--gray-700); }
.cat-toggle.open { transform: rotate(90deg); }
.cat-toggle.leaf { color: transparent; cursor: default; }

.cat-checkbox {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 2px solid var(--gray-300);
    background: var(--white);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    font-size: 10px;
    color: transparent;
}

.cat-checkbox.checked {
    background: var(--purple);
    border-color: var(--purple);
    color: var(--white);
}

.cat-checkbox.partial {
    background: var(--white);
    border-color: var(--purple);
    color: var(--purple);
}

.cat-label {
    flex: 1;
    font-size: 14px;
    color: var(--gray-800);
    line-height: 1.3;
}

.cat-leaf-count {
    font-size: 11px;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 1px 7px;
    border-radius: var(--radius-full);
}

.cat-children { margin-left: 26px; display: none; }
.cat-children.open { display: block; }
.cat-node.search-hidden { display: none; }

/* ---- Review Card ---- */
.review-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.review-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--gray-200);
    align-items: start;
}

.review-row:last-child { border-bottom: none; }

.review-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}

.review-value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 500;
    word-break: break-word;
}

.review-row-categories .review-value {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.review-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--purple-light);
    border: 1px solid rgba(136,82,248,0.2);
    color: var(--purple);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

/* ---- Navigation Buttons ---- */
.step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.btn-reg-next,
.btn-reg-back,
.btn-reg-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-reg-next,
.btn-reg-submit {
    background: var(--purple);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(136,82,248,0.35);
}

.btn-reg-next:hover,
.btn-reg-submit:hover {
    background: var(--purple-dark);
    box-shadow: 0 6px 20px rgba(136,82,248,0.45);
    transform: translateY(-1px);
}

.btn-reg-back {
    background: var(--white);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-300);
}

.btn-reg-back:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-400);
}

/* ---- Success Page ---- */
.reg-success-section {
    display: flex;
    align-items: center;
    padding: 60px 24px;
    background: var(--gray-50);
}

.success-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 56px 48px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .success-card { padding: 40px 24px; }
}

.success-icon-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
}

.success-icon {
    position: relative;
    z-index: 3;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--teal));
    color: var(--white);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 0;
    box-shadow: 0 8px 28px rgba(136,82,248,0.35);
}

.success-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

.success-ring-1 {
    width: 88px; height: 88px;
    border-color: rgba(136,82,248,0.25);
}

.success-ring-2 {
    width: 108px; height: 108px;
    border-color: rgba(136,82,248,0.12);
    animation-delay: 0.5s;
}

@keyframes pulseRing {
    0%   { transform: translate(-50%,-50%) scale(0.85); opacity:1; }
    100% { transform: translate(-50%,-50%) scale(1.3);  opacity:0; }
}

.success-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.success-message {
    font-size: 16px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 8px;
}

.success-sub {
    font-size: 14px;
    color: var(--gray-400);
    margin-bottom: 36px;
}

.success-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.success-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 110px;
}

.success-step-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--purple-light);
    color: var(--purple);
    font-size: 17px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(136,82,248,0.2);
}

.success-step p {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.4;
}

.success-step-arrow {
    color: var(--gray-300);
    font-size: 14px;
    margin-bottom: 18px;
}

.btn-success-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    border-radius: var(--radius-full);
    background: var(--purple);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(136,82,248,0.35);
    transition: all 0.2s;
}

.btn-success-home:hover {
    background: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(136,82,248,0.45);
    color: var(--white);
}
