/* Custom styles — GroupNet */

/* CSS custom properties (overridden by inline <style> from branding settings) */
:root {
    --gn-primary: #0d6efd;
    --gn-accent:  #198754;
    --gn-danger:  #dc3545;
    --gn-font:    system-ui, -apple-system, "Segoe UI", sans-serif;
    --gn-heading-font: var(--gn-font);
}

body {
    background-color: #f8f9fa;
    font-family: var(--gn-font);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gn-heading-font);
}

.navbar-brand {
    font-weight: 600;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    font-weight: 600;
}

/* Login / Portal pages centered card */
.auth-card {
    max-width: 480px;
    margin: 2rem auto;
}

.portal-card {
    max-width: 560px;
    margin: 2rem auto;
}

/* Stats cards on dashboard */
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gn-primary);
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Claim code / ID number display */
.claim-code {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--gn-primary);
    background: color-mix(in srgb, var(--gn-primary) 12%, white);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    display: inline-block;
}

/* Settings groups */
.settings-group {
    margin-bottom: 2rem;
}

.settings-group h5 {
    border-bottom: 2px solid var(--gn-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Template card in list */
.template-card {
    transition: box-shadow 0.15s;
}

.template-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Badge for template tags */
.badge-tag {
    font-size: 0.75rem;
}

/* Table styles */
.table th {
    white-space: nowrap;
}

/* Form sections */
.form-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #495057;
}

/* Password strength indicator */
.password-strength {
    height: 6px;
    border-radius: 3px;
    margin-top: 0.25rem;
    transition: all 0.3s;
    background: #e9ecef;
}

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

.password-strength-bar.weak   { background: var(--gn-danger);  width: 25%; }
.password-strength-bar.fair   { background: #ffc107;            width: 50%; }
.password-strength-bar.good   { background: var(--gn-accent);   width: 75%; }
.password-strength-bar.strong { background: var(--gn-primary);  width: 100%; }

.password-strength-label {
    font-size: 0.75rem;
    margin-top: 0.15rem;
    transition: color 0.3s;
}

/* Password policy checklist */
.policy-check {
    font-size: 0.85rem;
    transition: color 0.2s;
    padding: 0.1rem 0;
}

.policy-check.met {
    color: var(--gn-accent);
}

.policy-check.met i {
    color: var(--gn-accent);
}

.policy-check.unmet {
    color: #6c757d;
}

.policy-check.unmet i {
    color: #dee2e6;
}

/* Password toggle button */
.password-toggle {
    cursor: pointer;
    border-left: 0;
}

.password-toggle:hover {
    color: var(--gn-primary);
}

/* Audit log */
.audit-entry {
    border-left: 3px solid var(--gn-primary);
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.audit-entry.action-error {
    border-left-color: var(--gn-danger);
}

.audit-entry .audit-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Portal homepage tiles */
.portal-tile {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.portal-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

.portal-tile .card-title {
    color: #212529;
}

.portal-tile .card-text {
    color: #6c757d;
}

/* Form loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading .spinner-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Smooth form field focus */
.portal-card .form-control:focus,
.portal-card .form-select:focus {
    border-color: color-mix(in srgb, var(--gn-primary) 50%, white);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--gn-primary) 15%, transparent);
}

/* Success state animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    animation: fadeInUp 0.3s ease;
}

.alert-danger {
    animation: fadeInUp 0.3s ease;
}

/* Mobile responsive portal */
@media (max-width: 576px) {
    .portal-card {
        max-width: 100%;
        margin: 1rem auto;
    }

    .portal-card .card-body {
        padding: 1.25rem;
    }

    .portal-tile .display-4 {
        font-size: 2.5rem;
    }

    .portal-tile .card-body {
        padding: 1rem;
    }

    .portal-tile .card-text {
        font-size: 0.8rem;
    }

    .claim-code {
        font-size: 1.2rem;
        padding: 0.4rem 0.75rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .portal-card {
        max-width: 100%;
        margin: 1rem 0.5rem;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }
}

/* Step indicator for multi-step forms */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #adb5bd;
    transition: color 0.3s;
}

.step-indicator .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    margin-right: 0.4rem;
    transition: all 0.3s;
}

.step-indicator .step.active .step-number {
    background: var(--gn-primary);
    color: #fff;
}

.step-indicator .step.active {
    color: var(--gn-primary);
    font-weight: 600;
}

.step-indicator .step.completed .step-number {
    background: var(--gn-accent);
    color: #fff;
}

.step-indicator .step-divider {
    width: 40px;
    height: 2px;
    background: #dee2e6;
    margin: 0 0.5rem;
    align-self: center;
    transition: background 0.3s;
}

.step-indicator .step-divider.completed {
    background: var(--gn-accent);
}

/* Inline validation feedback */
.form-control.is-valid {
    border-color: var(--gn-accent);
    background-image: none;
}

.form-control.is-invalid {
    border-color: var(--gn-danger);
    background-image: none;
}
