/* ==========================================================================
   VROO-THEME.CSS
   Custom theme styles for Vroozi Login UI
   Replicates design system from purchasing-manager/vzi.view/src/css/custom-themes
   ========================================================================== */

/* ==========================================================================
   0. FONT FACE - Inter font (self-hosted)
   ========================================================================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter/inter-v19-cyrillic-regular.woff2') format('woff2'),
    url('../fonts/inter/inter-v19-cyrillic-regular.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter/inter-v19-cyrillic-500.woff2') format('woff2'),
    url('../fonts/inter/inter-v19-cyrillic-500.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter/inter-v19-cyrillic-600.woff2') format('woff2'),
    url('../fonts/inter/inter-v19-cyrillic-600.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter/inter-v19-cyrillic-700.woff2') format('woff2'),
    url('../fonts/inter/inter-v19-cyrillic-700.woff') format('woff');
}

/* ==========================================================================
   1. DESIGN TOKENS (CSS Variables)
   Source: purchasing-manager/vzi.view/src/css/custom-themes/tokens/
   ========================================================================== */
:root {
    /* Colors - from _colors.less */
    --color-text-primary: #1A1503;
    --color-text-primary-hover: #2a2205;
    --color-text-secondary: #6F767E;
    --color-gray-200: #F7F7F7;
    --color-gray-300: #E6E6E6;
    --color-gray-400: #DBDBDB;
    --color-shades-pure-white: #FFFFFF;
    --color-system-link: #3A90E5;
    --color-success: #00a63e;
    --color-error: #f54a00;
    --color-navigation-bg: #efeff0;

    /* Alert colors - Bootstrap alert overrides */
    --color-alert-success-bg: #dcfce7;
    --color-alert-success-border: #bbf7d0;
    --color-alert-success-text: #166534;
    --color-alert-danger-bg: #fef2f2;
    --color-alert-danger-border: #fecaca;
    --color-alert-danger-text: #991b1b;

    /* Border colors - derived from grays */
    --color-border-primary: var(--color-gray-300);
    --color-border-dark: var(--color-gray-400);

    /* Typography - from _typography.less */
    --font-family-basic: 'Inter', 'Roboto', 'Helvetica', sans-serif;
    --font-feature-settings: 'liga' off, 'clig' off;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 16px;
    --font-size-2xl: 24px;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-base: 1.5;

    /* Spacing - from _spacing.less */
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;

    /* Border radius - from _typography.less */
    --radius-lg: 12px;
    --radius-round: 100px;

    /* Border widths */
    --border-width-thin: 1px;
    --border-width-medium: 2px;

    /* Input dimensions */
    --input-height: 44px;
    --input-padding-y: 10px;
    --input-padding-x: 16px;

    /* Button dimensions */
    --btn-height: 44px;
    --btn-padding-y: 12px;
    --btn-padding-x: 24px;

    /* Opacity */
    --opacity-disabled: 0.3;

    /*Checkbox*/
    --cb-size: 18px;                                                /* Checkbox size */
    --cb-radius: 6px;                                               /* Checkbox border-radius */
    --cb-border: 1px;                                               /* Checkbox border width */
    --cb-icon-size: calc(var(--cb-size) - var(--cb-size) / 4);      /* Checkbox checked icon size */
}

/* ==========================================================================
   2. BASE STYLES
   Global font and text styles for .vroo-theme container
   ========================================================================== */
.vroo-theme,
.vroo-theme * {
    font-family: var(--font-family-basic);
}

.vroo-theme {
    font-feature-settings: var(--font-feature-settings);
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
}

/* ==========================================================================
   3. TYPOGRAPHY
   Headings, lead text, and links
   ========================================================================== */
.vroo-theme h1,
.vroo-theme h2,
.vroo-theme h3,
.vroo-theme h4,
.vroo-theme h5,
.vroo-theme h6 {
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-16);
}

.vroo-theme .lead {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.vroo-theme a {
    color: var(--color-system-link);
    text-decoration: none;
    font-style: normal;
    transition: all 0.2s ease-in-out;
}

.vroo-theme a:hover,
.vroo-theme a:focus {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.vroo-theme .forgot-password {
    color: var(--color-system-link);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
}

.vroo-theme .forgot-password:hover {
    color: var(--color-text-primary);
}

/* ==========================================================================
   4. LAYOUT - Landing Page Frame
   Card container for login/reset/expiry pages
   ========================================================================== */
.vroo-theme .landing-frame-outer {
    border-radius: var(--radius-lg);
    background-color: var(--color-shades-pure-white);
    box-shadow: 0 4px 24px -4px rgba(26, 21, 3, 0.12), 0 2px 8px -2px rgba(26, 21, 3, 0.08);
    padding: var(--space-32);
    width: 420px;
    max-width: 420px;
}

@media screen and (max-width: 767px) {
    .vroo-theme .landing-frame-outer {
        width: 95%;
        max-width: 95%;
        padding: var(--space-24);
    }
}

.vroo-theme .landing-frame-inner {
    width: 100%;
    max-width: 100%;
}

/* Supplier Discovery variant - frosted glass effect */
.vroo-theme.supplier-discovery .landing-frame-outer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px -8px rgba(26, 21, 3, 0.2);
}

/* ==========================================================================
   5. FORM CONTROLS
   Input fields, selects, textareas - Bootstrap overrides
   ========================================================================== */
.vroo-theme .form-control {
    border-radius: var(--radius-lg);
    border: var(--border-width-thin) solid var(--color-border-dark);
    box-shadow: none;
    transition: all 0.2s ease-in-out;
    height: var(--input-height);
    padding: var(--input-padding-y) var(--input-padding-x);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    background-color: var(--color-shades-pure-white);
    width: 100%;
    box-sizing: border-box;
}

.vroo-theme input.form-control {
    padding: var(--input-padding-y) var(--space-24) var(--input-padding-y) var(--input-padding-x);
}

.vroo-theme .form-control::placeholder {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-regular);
}

.vroo-theme .form-control:focus {
    outline: none;
    box-shadow: none !important;
    border-color: var(--color-border-dark);
}

.vroo-theme .form-control:disabled {
    background-color: var(--color-gray-200);
    cursor: not-allowed;
    opacity: var(--opacity-disabled);
}

/* Select dropdown - custom arrow */
.vroo-theme select.form-control {
    padding-right: var(--space-40);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231A1503' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: var(--space-12);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* Form group spacing */
.vroo-theme .form-group {
    margin-bottom: var(--space-16);
}

/* CHECKBOX */
.vroo-theme .vroo-checkbox__wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 0;
    vertical-align: top;
}

/* Hide native checkbox */
.vroo-theme .vroo-checkbox__wrapper input[type="checkbox"],
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Checkbox box */
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__box {
    width: var(--cb-size);
    height: var(--cb-size);
    background: var(--color-shades-pure-white);
    border: var(--cb-border) solid var(--color-text-secondary);
    border-radius: var(--cb-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s cubic-bezier(0.4, 0, 1, 1);
    flex-shrink: 0;
}

/* SVG inside checkbox */
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__box > svg {
    opacity: 0;
    color: var(--color-brand-primary);
    width: var(--cb-icon-size);
    height: var(--cb-icon-size);
}

/* Fallback checkmark (no SVG) */
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__box::after {
    content: "";
    display: inline-block;
    width: var(--cb-icon-size);
    height: var(--cb-icon-size);
    opacity: 0;
    transition: opacity 0.15s ease;
    background-image: url("data:image/svg+xml;utf8,<svg id='icon-check-mark' viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'><polyline points='40 144 96 200 224 72' fill='none' stroke='%23FDDF65' stroke-linecap='round' stroke-linejoin='round' stroke-width='24'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Disabled state */
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__input:disabled + .vroo-checkbox__box {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    background-color: var(--color-gray-300);
}

/* Checked state */
.vroo-theme .vroo-checkbox__wrapper input[type="checkbox"]:checked + .vroo-checkbox__box,
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__input:checked + .vroo-checkbox__box {
    background: var(--color-text-primary);
}

.vroo-theme .vroo-checkbox__wrapper input[type="checkbox"]:checked + .vroo-checkbox__box > svg,
.vroo-theme .vroo-checkbox__wrapper input[type="checkbox"]:checked + .vroo-checkbox__box::after,
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__input:checked + .vroo-checkbox__box > svg,
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__input:checked + .vroo-checkbox__box::after {
    opacity: 1;
}

/* Hover state */
.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__box:hover:not(.disabled) {
    border-color: var(--color-text-primary);
}

.vroo-theme .vroo-checkbox__wrapper .vroo-checkbox__box.checked:hover:not(.disabled) {
    box-shadow:
            inset 0 1px 1px rgba(0, 0, 0, 0.075),
            0 0 7px -2px var(--color-text-primary);
}

/* ==========================================================================
   6. FORM VALIDATION FEEDBACK ICONS
   Checkmark and exclamation icons positioning
   ========================================================================== */
.vroo-theme .has-feedback {
    position: relative;
}

.vroo-theme .has-feedback .form-control {
    padding-right: 42px;
}

.vroo-theme .has-feedback select.form-control {
    padding-right: 80px !important;
    background-position: right 54px center !important;
}

.vroo-theme .has-feedback .form-control-feedback {
    position: absolute;
    right: 12px !important;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 2;
}

/* Select validation icons - position left of dropdown arrow */
.vroo-theme select.form-control ~ .form-control-feedback {
    right: 40px !important;
}

/* ==========================================================================
   7. FORM VALIDATION STATES
   Green/red border colors for valid/invalid fields
   ========================================================================== */

/* AngularJS validation classes - applied automatically */
.vroo-theme .form-control.ng-valid.ng-dirty {
    border-color: var(--color-success) !important;
}

.vroo-theme .form-control.ng-invalid.ng-dirty {
    border-color: var(--color-error) !important;
}

/* Bootstrap validation classes - fallback */
.vroo-theme .has-success .form-control {
    border-color: var(--color-success) !important;
}

.vroo-theme .has-error .form-control {
    border-color: var(--color-error) !important;
}

/* Input type spacing */
.vroo-theme input[type="email"],
.vroo-theme input[type="text"],
.vroo-theme input[type="password"],
.vroo-theme input[type="tel"],
.vroo-theme select,
.vroo-theme textarea {
    margin-bottom: var(--space-12);
}

/* ==========================================================================
   8. BUTTONS
   Primary submit button and secondary action button styles
   ========================================================================== */

/* Base button styles - shared between .form-submit and .form-action */
.vroo-theme .form-submit,
.vroo-theme .form-action {
    border-radius: var(--radius-round);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    height: var(--btn-height);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    width: 100%;
    gap: var(--space-8);
    outline: none;
}

/* Primary button (.form-submit) - dark background */
.vroo-theme .form-submit,
.vroo-theme button.form-submit,
.vroo-theme input.form-submit,
.vroo-theme .form-control.form-submit,
.vroo-theme input[type="submit"].form-submit,
.vroo-theme button[type="submit"].form-submit {
    background-color: var(--color-text-primary) !important;
    background-image: none !important;
    color: var(--color-shades-pure-white) !important;
    border: var(--border-width-medium) solid var(--color-text-primary) !important;
    text-shadow: none !important;
}

.vroo-theme .form-submit:hover:not(:disabled),
.vroo-theme button.form-submit:hover:not(:disabled),
.vroo-theme input.form-submit:hover:not(:disabled),
.vroo-theme .form-control.form-submit:hover:not(:disabled),
.vroo-theme input[type="submit"].form-submit:hover:not(:disabled),
.vroo-theme button[type="submit"].form-submit:hover:not(:disabled) {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.15) 100%), var(--color-text-primary) !important;
    background-color: var(--color-text-primary-hover) !important;
    color: var(--color-shades-pure-white) !important;
    box-shadow: 0 4px 12px -4px rgba(26, 21, 3, 0.3);
}

.vroo-theme .form-submit:focus,
.vroo-theme button.form-submit:focus,
.vroo-theme input.form-submit:focus,
.vroo-theme .form-control.form-submit:focus,
.vroo-theme input[type="submit"].form-submit:focus,
.vroo-theme button[type="submit"].form-submit:focus {
    background-color: var(--color-text-primary) !important;
    color: var(--color-shades-pure-white) !important;
    box-shadow: 0 0 0 3px rgba(253, 223, 101, 0.4) !important;
}

.vroo-theme .form-submit:active:not(:disabled),
.vroo-theme button.form-submit:active:not(:disabled),
.vroo-theme input.form-submit:active:not(:disabled),
.vroo-theme .form-control.form-submit:active:not(:disabled),
.vroo-theme input[type="submit"].form-submit:active:not(:disabled),
.vroo-theme button[type="submit"].form-submit:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 6px -2px rgba(26, 21, 3, 0.3);
}

.vroo-theme .form-submit:disabled,
.vroo-theme button.form-submit:disabled,
.vroo-theme input.form-submit:disabled,
.vroo-theme .form-control.form-submit:disabled,
.vroo-theme input[type="submit"].form-submit:disabled,
.vroo-theme button[type="submit"].form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--color-text-primary) !important;
    color: var(--color-shades-pure-white) !important;
}

/* Secondary button (.form-action) - outlined style */
.vroo-theme .form-action {
    background-color: var(--color-shades-pure-white);
    color: var(--color-text-primary);
    border: var(--border-width-medium) solid var(--color-text-primary);
}

.vroo-theme .form-action:hover:not(:disabled) {
    background-color: var(--color-gray-200);
}

.vroo-theme .form-action:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
}

.vroo-theme button.form-control:disabled {
    border-radius: var(--radius-round);
}

/* SSO login button (.login-via) */
.vroo-theme .login-via {
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    height: var(--btn-height);
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    text-align: center;
    text-decoration: none;
    background-color: var(--color-shades-pure-white);
    color: var(--color-text-primary);
    border: var(--border-width-thin) solid var(--color-border-dark);
}

.vroo-theme .login-via:hover {
    background-color: var(--color-gray-200);
    text-decoration: none;
    color: var(--color-text-primary);
}

.vroo-theme .login-via.sdm {
    background-color: var(--color-gray-200);
    border-color: var(--color-border-dark);
}

.vroo-theme .login-via.sdm:hover {
    background-color: var(--color-gray-300);
}

/* Button spacing */
.vroo-theme button {
    margin-bottom: var(--space-16);
}

/* Supplier registration - increase container heights */
.vroo-theme .registration .content .form-container {
    height: 610px;
    padding: var(--space-24);
}

.vroo-theme .registration .content .form-container .title {
    margin-bottom: 0;
}

.vroo-theme .registration .content .logo-container {
    height: 610px;
}

@media (max-width: 991px) {
    .vroo-theme .registration .content .form-container {
        height: 685px;
    }

    .vroo-theme .registration .content .logo-container {
        height: 685px;
    }
}

/* Supplier registration - Terms link blue */
.vroo-theme .terms-and-conditions a {
    color: var(--color-system-link) !important;
}

/* Supplier registration - contact info white text */
.vroo-theme .contact-info-container,
.vroo-theme .contact-info-container .contact-info,
.vroo-theme .contact-info-container .contact-info__header {
    color: var(--color-shades-pure-white);
}

/* Supplier registration - password mismatch alert padding */
.vroo-theme .alert-for-password-mismatch {
    padding: 12px !important;
}

/* Supplier registration button override */
.vroo-theme .user_registration--button {
    background-color: var(--color-text-primary) !important;
    color: var(--color-shades-pure-white) !important;
    border: var(--border-width-medium) solid var(--color-text-primary) !important;
    border-radius: var(--radius-round);
}

.vroo-theme .user_registration--button:hover:not(:disabled) {
    background-color: var(--color-text-primary-hover) !important;
}

.vroo-theme .user_registration--button:disabled {
    opacity: 0.5;
    background-color: var(--color-text-primary) !important;
    color: var(--color-shades-pure-white) !important;
}

/* ==========================================================================
   9. ALERTS
   Success and danger notification banners
   ========================================================================== */
.vroo-theme .alert {
    border-radius: var(--radius-lg);
    padding: var(--space-16);
    margin-bottom: var(--space-16);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.vroo-theme .alert strong {
    font-weight: var(--font-weight-bold);
}

.vroo-theme .alert-success {
    background-color: var(--color-alert-success-bg);
    border: var(--border-width-thin) solid var(--color-alert-success-border);
    color: var(--color-alert-success-text);
}

.vroo-theme .alert-danger {
    background-color: var(--color-alert-danger-bg);
    border: var(--border-width-thin) solid var(--color-alert-danger-border);
    color: var(--color-alert-danger-text);
}

/* ==========================================================================
   10. FIELDSET DIVIDER
   "OR" divider line with centered legend text
   ========================================================================== */
.vroo-theme fieldset.title {
    border: none;
    padding: 0;
    margin: var(--space-24) 0;
    position: relative;
    text-align: center;
}

.vroo-theme fieldset.title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background-color: var(--color-border-dark);
}

.vroo-theme fieldset.title legend {
    position: relative;
    display: inline-block;
    padding: 0 var(--space-16);
    background-color: var(--color-shades-pure-white);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   11. IMAGES & ICONS
   Logo, powered-by badge, loading spinner, validation icons
   ========================================================================== */
.vroo-theme .landing-logo {
    display: block;
    margin: var(--space-32) auto var(--space-40);
    width: 100%;
    max-width: 200px;
    height: auto;
}

.vroo-theme .powered-by {
    display: block;
    margin: var(--space-24) auto auto;
    max-width: 120px;
    opacity: 0.6;
}

/* Loading spinner animation */
.vroo-theme .loading-icon {
    width: 40px;
    height: 40px;
    margin: var(--space-40) auto;
    border: 3px solid var(--color-gray-300);
    border-top-color: var(--color-text-primary);
    border-radius: 50%;
    animation: vroo-spin 0.8s linear infinite;
}

@keyframes vroo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Validation icons */
.vroo-theme .icon-check-mark {
    color: var(--color-success);
}

.vroo-theme .icon-exclamation {
    color: var(--color-error);
}

/* ==========================================================================
   12. UTILITY CLASSES
   Text colors, wells, row spacing
   ========================================================================== */
.vroo-theme .text-danger {
    color: var(--color-error);
    font-size: var(--font-size-sm);
}

.vroo-theme .text-success {
    color: var(--color-success);
}

.vroo-theme .well {
    border-radius: var(--radius-lg);
    background-color: var(--color-gray-200);
    border: var(--border-width-thin) solid var(--color-border-primary);
    padding: var(--space-20);
    margin-bottom: var(--space-16);
}

.vroo-theme .well-sm {
    padding: var(--space-12);
}

.vroo-theme .row {
    margin-top: var(--space-16);
}

/* ==========================================================================
   13. PAGE BACKGROUNDS
   Landing wrapper background styles
   ========================================================================== */
.vroo-theme.landing-wrapper {
    background-color: var(--color-navigation-bg);
    background-image: none;
}

/* ==========================================================================
   14. EXPIRY PAGE
   Session expired page specific styles
   ========================================================================== */
.vroo-theme .expiry-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-20);
    text-align: center;
}

.vroo-theme .expiry-message {
    text-align: center;
    color: var(--color-text-secondary);
    line-height: var(--line-height-base);
}

.vroo-theme .expiry-message p {
    margin-bottom: var(--space-16);
}

.vroo-theme .expiry-message p:last-child {
    margin-bottom: 0;
}

.vroo-theme .intl-tel-input .selected-flag {
    border-radius: var(--radius-lg);
}
