/* ==================================================
   GRIPPER COLOMBIA - REGISTRATION FORM PROTOTYPE
   Custom CSS for Manager Cargo Integration
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Raleway:wght@300;400;600;700&display=swap');

.grp-body {
    /* Colors derived from index.css */
    --grp-primary: #2568d5;
    --grp-primary-hover: #1f57b7;
    --grp-bg: #ffffff;
    --grp-bg-body: #f7f9fb;
    
    --grp-text: #262626;
    --grp-text-muted: #697581;
    --grp-text-light: #697581;
    
    --grp-border: #dfe5ec;
    --grp-border-hover: #c0c9d3;
    --grp-border-focus: #3479ed;
    
    --grp-danger: #d46a6a;
    --grp-danger-bg: #fff7f7;
    --grp-success: #32875c;
    --grp-success-bg: #f1faf5;
    
    /* Typography */
    --grp-font-sans: 'Open Sans', system-ui, sans-serif;
    --grp-font-heading: 'Raleway', system-ui, sans-serif;
    
    /* Sizes & Spacing */
    --grp-radius: 3px;
    --grp-input-height: 48px;
    --grp-touch-target: 44px;
    --grp-transition: 0.2s ease-in-out;
}

/* Base Reset */
.grp-body {
    font-family: var(--grp-font-sans);
    background-color: var(--grp-bg-body);
    color: var(--grp-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.grp-body [hidden] {
    display: none !important;
}

.grp-body,
.grp-body *,
.grp-body *::before,
.grp-body *::after {
    box-sizing: border-box;
}

/* Layout */
.grp-layout {
    width: 100%;
    max-width: 600px;
    padding: 24px 16px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grp-back-home-wrap {
    width: 100%;
    margin-bottom: 8px;
}

.grp-back-home {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 4px;
    margin-left: -4px;
    color: var(--grp-primary-hover);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: color var(--grp-transition), text-decoration-color var(--grp-transition);
}

.grp-back-home:hover {
    color: #1f57b7;
    text-decoration: underline;
}

.grp-back-home:focus-visible {
    outline: 2px solid var(--grp-primary);
    outline-offset: 2px;
    border-radius: var(--grp-radius);
}

.grp-header {
    margin-bottom: 32px;
    text-align: center;
}

.grp-logo-link {
    display: inline-flex;
    padding: 2px;
    border-radius: var(--grp-radius);
}

.grp-logo-link:focus-visible {
    outline: 2px solid var(--grp-primary);
    outline-offset: 4px;
}

.grp-logo {
    height: 40px;
    width: auto;
}

/* Card Container */
.grp-card {
    width: 100%;
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden;
}

.grp-card-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
}

.grp-title {
    font-family: var(--grp-font-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--grp-text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.grp-subtitle {
    font-size: 14px;
    color: var(--grp-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Progress Indicator */
.grp-progress {
    padding: 24px 32px 0;
}

/* Desktop Progress */
.grp-progress-desktop {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.grp-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: opacity var(--grp-transition);
}

.grp-step-item.active,
.grp-step-item.completed {
    opacity: 1;
}

.grp-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--grp-border);
    color: var(--grp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.grp-step-item.active .grp-step-num {
    background-color: var(--grp-primary);
    color: #fff;
}

.grp-step-item.completed .grp-step-num {
    background-color: var(--grp-success);
    color: #fff;
}

.grp-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--grp-text);
}

.grp-step-line {
    flex: 1;
    height: 2px;
    background-color: var(--grp-border);
    margin: 0 16px;
}

/* Mobile Progress */
.grp-progress-mobile {
    display: block;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .grp-progress-desktop { display: flex; }
    .grp-progress-mobile { display: none; }
}

.grp-mobile-step-text {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--grp-text-muted);
    margin-bottom: 8px;
}

.grp-progress-bar {
    height: 4px;
    background-color: var(--grp-border);
    border-radius: 2px;
    overflow: hidden;
}

.grp-progress-fill {
    width: 33.333%;
    height: 100%;
    background-color: var(--grp-primary);
    transition: width 0.3s ease;
}

/* Form Container */
.grp-form {
    padding: 0 32px 32px;
}

@media (max-width: 767px) {
    .grp-card-header { padding: 24px 20px 16px; }
    .grp-progress { padding: 20px 20px 0; }
    .grp-form { padding: 0 20px 24px; }
}

/* Step Content */
.grp-step-content {
    display: none;
    animation: grp-fade-in 0.3s ease;
}

.grp-step-content.active {
    display: block;
}

@keyframes grp-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Fields */
.grp-field {
    margin-bottom: 20px;
    position: relative;
}

.grp-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 576px) {
    .grp-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.grp-label {
    display: block;
    font-family: var(--grp-font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--grp-text);
    margin-bottom: 6px;
}

.grp-req { color: var(--grp-primary); }
.grp-opt { color: var(--grp-text-muted); font-weight: 400; font-family: var(--grp-font-sans); font-size: 13px; }

.grp-input,
.grp-select {
    width: 100%;
    height: var(--grp-input-height);
    background-color: #fff;
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-radius);
    padding: 0 16px;
    font-family: var(--grp-font-sans);
    font-size: 14px;
    color: var(--grp-text);
    transition: all var(--grp-transition);
    appearance: none;
}

.grp-select:disabled,
.grp-input:disabled {
    cursor: not-allowed;
    background-color: #f3f5f7;
    color: var(--grp-text-muted);
}

.grp-input::placeholder {
    color: var(--grp-text-light);
}

.grp-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697581' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.grp-input:hover,
.grp-select:hover {
    border-color: var(--grp-border-hover);
}

.grp-input:focus,
.grp-select:focus {
    outline: none;
    border-color: var(--grp-border-focus);
    box-shadow: 0 0 0 2px rgba(37, 104, 213, 0.1);
}

/* Error States */
.grp-input[aria-invalid="true"],
.grp-select[aria-invalid="true"] {
    border-color: var(--grp-danger);
    background-color: #fffafA;
}

.grp-input[aria-invalid="true"]:focus,
.grp-select[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 2px rgba(212, 106, 106, 0.1);
}

.grp-error-msg {
    display: none;
    font-size: 12px;
    color: #b54949;
    margin-top: 6px;
}

.grp-error-msg.visible {
    display: block;
}

.grp-hint {
    display: block;
    font-size: 12px;
    color: var(--grp-text-muted);
    margin-top: 6px;
}

/* Password Wrapper */
.grp-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.grp-password-toggle {
    position: absolute;
    right: 0;
    height: 100%;
    width: 48px;
    background: transparent;
    border: none;
    color: var(--grp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color var(--grp-transition);
}

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

.grp-password-toggle:focus-visible {
    outline: 2px solid var(--grp-primary);
    border-radius: var(--grp-radius);
}

/* Checkbox */
.grp-checkbox-field {
    margin-top: 24px;
    margin-bottom: 24px;
}

.grp-checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    user-select: none;
    gap: 4px;
}

.grp-checkbox-control {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.grp-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.grp-checkbox-mark {
    position: relative;
    top: 2px;
    flex-shrink: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1px solid var(--grp-border);
    border-radius: 3px;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.grp-checkbox-control:hover .grp-checkbox-mark {
    border-color: var(--grp-border-hover);
}

.grp-checkbox-container input:checked + .grp-checkbox-control .grp-checkbox-mark {
    background-color: var(--grp-primary);
    border-color: var(--grp-primary);
}

.grp-checkbox-container input:focus-visible + .grp-checkbox-control .grp-checkbox-mark {
    box-shadow: 0 0 0 2px rgba(37, 104, 213, 0.3);
}

.grp-checkbox-container input[aria-invalid="true"] + .grp-checkbox-control .grp-checkbox-mark {
    border-color: var(--grp-danger);
    background-color: var(--grp-danger-bg);
}

.grp-checkbox-mark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.grp-checkbox-container input:checked + .grp-checkbox-control .grp-checkbox-mark:after {
    display: block;
}

.grp-checkbox-label {
    font-size: 14px;
    color: var(--grp-text);
    line-height: 1.5;
    padding-top: 1px;
}

.grp-link {
    color: var(--grp-primary);
    text-decoration: none;
    font-weight: 600;
}

.grp-link:hover {
    text-decoration: underline;
}

.grp-link-button {
    display: inline;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
    line-height: 1.5;
}

.grp-link-button:focus-visible {
    outline: 2px solid var(--grp-primary);
    outline-offset: 2px;
}

/* reCAPTCHA Placeholder */
.grp-recaptcha-placeholder {
    margin-bottom: 24px;
}

.grp-recaptcha-box {
    background: #fafafa;
    border: 1px dashed var(--grp-border);
    border-radius: var(--grp-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--grp-text-muted);
    font-size: 13px;
}

/* Actions & Buttons */
.grp-actions {
    margin-top: 32px;
    border-top: 1px solid #f1f3f5;
    padding-top: 24px;
}

.grp-actions-split {
    display: flex;
    gap: 16px;
    flex-direction: column-reverse;
}

@media (min-width: 576px) {
    .grp-actions-split {
        flex-direction: row;
        justify-content: space-between;
    }
}

.grp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--grp-input-height);
    padding: 0 24px;
    font-family: var(--grp-font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: var(--grp-radius);
    cursor: pointer;
    transition: all var(--grp-transition);
    border: none;
    text-decoration: none;
}

.grp-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--grp-primary);
}

.grp-btn-primary {
    background-color: var(--grp-primary);
    color: #fff;
}

.grp-btn-primary:hover {
    background-color: var(--grp-primary-hover);
}

.grp-btn-primary:disabled {
    background-color: #a0bbf0;
    cursor: not-allowed;
}

.grp-btn-secondary {
    background-color: #fff;
    color: var(--grp-text-muted);
    border: 1px solid var(--grp-border);
}

.grp-btn-secondary:hover {
    background-color: var(--grp-bg-body);
    color: var(--grp-text);
}

.grp-btn-block {
    width: 100%;
}

@media (min-width: 576px) {
    .grp-actions-split .grp-btn {
        min-width: 140px;
    }
}

/* Loading Spinner */
.grp-spinner {
    animation: grp-rotate 2s linear infinite;
    z-index: 2;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}
.grp-spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: grp-dash 1.5s ease-in-out infinite;
}
@keyframes grp-rotate { 100% { transform: rotate(360deg); } }
@keyframes grp-dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.grp-btn-loader {
    display: flex;
    align-items: center;
}

/* Footer Login */
.grp-footer-login {
    margin-top: 24px;
    font-size: 14px;
    color: var(--grp-text-muted);
    text-align: center;
}

.grp-link-bold {
    color: var(--grp-primary);
    font-weight: 700;
    text-decoration: none;
}

.grp-link-bold:hover {
    text-decoration: underline;
}

/* Success State */
.grp-success-state {
    padding: 48px 32px;
    text-align: center;
    animation: grp-fade-in 0.4s ease;
}

.grp-success-icon {
    width: 80px;
    height: 80px;
    background-color: var(--grp-success-bg);
    color: var(--grp-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.grp-success-title {
    font-family: var(--grp-font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--grp-text);
    margin: 0 0 12px;
}

.grp-success-desc {
    font-size: 15px;
    color: var(--grp-text-muted);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto 32px;
}

.grp-mt-4 {
    margin-top: 16px;
}

/* Accessible legal dialog */
.grp-dialog {
    width: min(520px, calc(100% - 32px));
    border: 1px solid var(--grp-border);
    border-radius: var(--grp-radius);
    padding: 24px;
    color: var(--grp-text);
    background: #fff;
    box-shadow: 0 16px 48px rgba(35, 54, 75, 0.2);
}

.grp-dialog::backdrop {
    background: rgba(25, 34, 44, 0.55);
}

.grp-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.grp-dialog-title {
    margin: 0;
    font-family: var(--grp-font-heading);
    font-size: 23px;
    font-weight: 600;
}

.grp-dialog-close {
    display: inline-flex;
    min-width: var(--grp-touch-target);
    min-height: var(--grp-touch-target);
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--grp-text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.grp-dialog-close:focus-visible {
    outline: 2px solid var(--grp-primary);
    outline-offset: 2px;
}

.grp-dialog-content {
    margin-bottom: 24px;
    color: var(--grp-text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.grp-dialog-content p {
    margin: 0 0 12px;
}