/* ==================================================
   GRIPPER COLOMBIA - LOGIN 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-login-page {
    /* Colors derived from index.css and registration */
    --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-transition: 0.2s ease-in-out;
}

/* Base Reset */
.grp-login-page {
    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-login-page [hidden] {
    display: none !important;
}

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

/* Layout */
.grp-layout {
    width: 100%;
    padding: 32px 16px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@media (max-width: 767px) {
    .grp-layout {
        padding: 24px 16px;
        justify-content: flex-start;
    }
}

.grp-back-home-wrap {
    width: 100%;
    max-width: 460px;
    margin: 0 auto 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: var(--grp-primary-hover);
    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: 24px;
    text-align: center;
    z-index: 2;
}

.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 Wrapper with Subtle Glow */
.grp-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 460px; /* 450-480px target */
    margin: 0 auto;
    z-index: 1;
}

.grp-card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(52, 121, 237, 0.08) 0%, rgba(52, 121, 237, 0) 70%);
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
}

/* Card Container */
.grp-card {
    background: var(--grp-bg);
    border: 1px solid var(--grp-border);
    border-radius: 8px; /* Slightly smoother for the compact card */
    box-shadow: 0 8px 32px -4px rgba(35, 54, 75, 0.04), 0 4px 12px -2px rgba(35, 54, 75, 0.03);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.grp-card-header {
    padding: 32px 24px 16px;
    text-align: center;
}

.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: 15px;
    color: var(--grp-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Auth Alert (Server-side Error) */
.grp-auth-alert {
    margin: 0 24px 16px;
    padding: 12px 16px;
    background-color: var(--grp-danger-bg);
    border: 1px solid var(--grp-danger);
    border-radius: var(--grp-radius);
    color: #b54949;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.4;
}

.grp-auth-alert svg {
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

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

.grp-form-fields {
    padding: 0 24px 8px;
}

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

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

.grp-input {
    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-input::placeholder {
    color: var(--grp-text-light);
}

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

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

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

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

.grp-input[aria-invalid="true"]:focus {
    outline-color: var(--grp-danger);
    box-shadow: 0 2px 8px 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;
}

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

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

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

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

/* Links */
.grp-link {
    color: var(--grp-primary-hover);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.grp-link-sm {
    font-size: 13px;
    font-weight: 600;
}

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

.grp-forgot-pwd {
    margin-top: 8px;
    text-align: right;
}

/* Actions & Buttons */
.grp-actions {
    margin-top: 24px;
}

.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: 15px;
    font-weight: 600; /* Reduced from 700 */
    letter-spacing: 0.01em;
    border-radius: var(--grp-radius);
    cursor: pointer;
    transition: all var(--grp-transition);
    border: none;
    text-decoration: none;
}

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

.grp-btn-primary {
    background-color: var(--grp-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(52, 121, 237, 0.2);
}

.grp-btn-primary:hover {
    background-color: var(--grp-primary-hover);
    box-shadow: 0 4px 12px rgba(52, 121, 237, 0.25);
}

.grp-btn-primary:active {
    background-color: var(--grp-primary-hover);
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(52, 121, 237, 0.15);
}

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

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

/* 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;
}

/* Card Footer (Creation & Language) */
.grp-card-footer {
    background-color: #fcfcfc;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.grp-footer-login {
    font-size: 14px;
    color: var(--grp-text-muted);
    text-align: center;
}

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

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

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

/* Language Switcher - Very Discreet */
.grp-lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.grp-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.grp-select-discreet {
    appearance: none;
    background-color: transparent;
    border: none;
    color: var(--grp-text-muted);
    font-family: var(--grp-font-sans);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 16px 4px 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23697581' stroke-width='2.5' 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 2px center;
    cursor: pointer;
    transition: color var(--grp-transition);
}

.grp-select-discreet:hover,
.grp-select-discreet:focus {
    color: var(--grp-text-muted);
    outline: none;
}

.grp-select-discreet:focus-visible {
    outline: 2px solid var(--grp-border);
    border-radius: 2px;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .grp-card-header { padding: 24px 20px 16px; }
    .grp-auth-alert { margin: 0 20px 16px; }
    .grp-form-fields { padding: 0 20px 8px; }
    .grp-card-footer { padding: 20px; }
    .grp-title { font-size: 26px; }
    .grp-subtitle { font-size: 14px; }

    .grp-card-glow { display: none; } /* Better performance on mobile, no glow needed */
    .grp-card { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
}
