/* TechBid Registration — Frontend */

:root {
    --tbreg-primary: #FF671F;
    --tbreg-primary-hover: #e55a15;
    --tbreg-primary-light: #fff3ec;
    --tbreg-text: #1a1a2e;
    --tbreg-text-secondary: #5a5a7a;
    --tbreg-border: #e0e0e8;
    --tbreg-bg: #ffffff;
    --tbreg-bg-section: #f8f8fb;
    --tbreg-error: #d32f2f;
    --tbreg-success: #2e7d32;
    --tbreg-radius: 8px;
    --tbreg-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Wrapper */
.tbreg-wrapper {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: var(--tbreg-font);
}

.tbreg-container {
    background: var(--tbreg-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--tbreg-border);
    padding: 40px 36px;
}

@media (max-width: 600px) {
    .tbreg-container { padding: 28px 20px; }
    .tbreg-wrapper { margin: 20px auto; }
}

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

.tbreg-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--tbreg-text);
    margin: 0 0 8px;
}

.tbreg-header p {
    font-size: 15px;
    color: var(--tbreg-text-secondary);
    margin: 0;
}

/* Type Selector */
.tbreg-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.tbreg-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid var(--tbreg-border);
    border-radius: var(--tbreg-radius);
    background: var(--tbreg-bg);
    color: var(--tbreg-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tbreg-type-btn:hover {
    border-color: var(--tbreg-primary);
    color: var(--tbreg-primary);
    background: var(--tbreg-primary-light);
}

.tbreg-type-btn.active {
    border-color: var(--tbreg-primary);
    background: var(--tbreg-primary-light);
    color: var(--tbreg-primary);
}

.tbreg-type-btn svg {
    flex-shrink: 0;
}

/* Sections */
.tbreg-section {
    margin-bottom: 28px;
}

.tbreg-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--tbreg-text);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tbreg-primary-light);
}

/* Fields */
.tbreg-field {
    margin-bottom: 16px;
}

.tbreg-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tbreg-text);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.tbreg-field label .required {
    color: var(--tbreg-primary);
}

.tbreg-field input[type="text"],
.tbreg-field input[type="email"],
.tbreg-field input[type="tel"],
.tbreg-field input[type="password"],
.tbreg-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--tbreg-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--tbreg-text);
    background: var(--tbreg-bg-section);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.tbreg-field input:focus,
.tbreg-field select:focus {
    outline: none;
    border-color: var(--tbreg-primary);
    box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.1);
    background: #fff;
}

.tbreg-field input::placeholder {
    color: #b0b0c0;
    opacity: 1;
}

.tbreg-field input.tbreg-error {
    border-color: var(--tbreg-error);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.08);
}

.tbreg-hint {
    display: block;
    font-size: 12px;
    color: var(--tbreg-text-secondary);
    margin-top: 4px;
}

/* Rows */
.tbreg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tbreg-field-wide {
    grid-column: span 1;
    flex: 2;
}

.tbreg-field-narrow {
    grid-column: span 1;
    flex: 1;
}

@media (max-width: 500px) {
    .tbreg-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Phone row */
.tbreg-phone-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
}

.tbreg-phone-row select {
    padding: 11px 8px;
    font-size: 13px;
}

/* Password */
.tbreg-password-wrap {
    position: relative;
}

.tbreg-password-wrap input {
    padding-right: 44px;
}

.tbreg-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tbreg-text-secondary);
    padding: 4px;
    display: flex;
}

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

/* Password strength */
.tbreg-password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: var(--tbreg-border);
    overflow: hidden;
    transition: all 0.3s;
}

.tbreg-password-strength .tbreg-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.tbreg-strength-weak { width: 33%; background: #f44336; }
.tbreg-strength-medium { width: 66%; background: #ff9800; }
.tbreg-strength-strong { width: 100%; background: #4caf50; }

/* Multi-select dropdown */
.tbreg-multiselect {
    position: relative;
}

.tbreg-multiselect-trigger {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--tbreg-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--tbreg-text);
    background: var(--tbreg-bg-section);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    -webkit-user-select: none;
    user-select: none;
}

.tbreg-multiselect-trigger:focus {
    outline: none;
    border-color: var(--tbreg-primary);
    box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.1);
    background: #fff;
}

.tbreg-multiselect.open .tbreg-multiselect-trigger {
    border-color: var(--tbreg-primary);
    box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.1);
    background: #fff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tbreg-multiselect-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.tbreg-multiselect-trigger svg {
    flex-shrink: 0;
    color: var(--tbreg-text-secondary);
    transition: transform 0.2s;
}

.tbreg-multiselect.open .tbreg-multiselect-trigger svg {
    transform: rotate(180deg);
}

.tbreg-multiselect-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--tbreg-primary);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
}

.tbreg-multiselect.open .tbreg-multiselect-dropdown {
    display: block;
}

.tbreg-multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--tbreg-text);
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1.4;
    font-weight: 400;
}

.tbreg-multiselect-option:hover {
    background: var(--tbreg-primary-light);
}

.tbreg-multiselect-option input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--tbreg-primary);
    cursor: pointer;
    margin: 0;
}

.tbreg-multiselect-other {
    border-top: 1px solid var(--tbreg-border);
}

/* Consents */
.tbreg-consents {
    padding-top: 8px;
}

.tbreg-checkbox-field {
    margin-bottom: 16px;
}

.tbreg-checkbox-field label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--tbreg-text);
    cursor: pointer;
    line-height: 1.5;
    font-weight: 400;
}

.tbreg-checkbox-field input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--tbreg-primary);
    cursor: pointer;
}

.tbreg-checkbox-field .required {
    color: var(--tbreg-primary);
}

.tbreg-consent-desc {
    font-size: 12px;
    color: var(--tbreg-text-secondary);
    margin: 4px 0 0 28px;
    line-height: 1.5;
}

.tbreg-terms-link {
    display: block;
    font-size: 12px;
    color: var(--tbreg-primary);
    margin-left: 28px;
    margin-top: 2px;
    text-decoration: none;
}

.tbreg-terms-link:hover {
    text-decoration: underline;
}

/* reCAPTCHA */
.tbreg-recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

/* Submit */
.tbreg-submit-wrap {
    margin-top: 28px;
}

.tbreg-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--tbreg-primary);
    color: #fff;
    border: none;
    border-radius: var(--tbreg-radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.tbreg-submit-btn:hover {
    background: var(--tbreg-primary-hover);
}

.tbreg-submit-btn:active {
    transform: scale(0.99);
}

.tbreg-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.tbreg-submit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tbreg-spinner {
    animation: tbreg-spin 1s linear infinite;
}

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

/* Footer link */
.tbreg-footer-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tbreg-border);
    font-size: 14px;
    color: var(--tbreg-text-secondary);
}

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

.tbreg-footer-link a:hover {
    text-decoration: underline;
}

/* Messages */
.tbreg-messages {
    margin-bottom: 16px;
}

.tbreg-messages:empty {
    display: none;
}

.tbreg-msg {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.tbreg-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--tbreg-error);
}

.tbreg-msg-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--tbreg-success);
}

/* Notice on other pages */
.tbreg-notice {
    max-width: 600px;
    margin: 40px auto;
    padding: 24px 30px;
    border-radius: var(--tbreg-radius);
    font-family: var(--tbreg-font);
}

.tbreg-notice h3 {
    margin: 0 0 8px;
}

.tbreg-notice-warning {
    background: #fff8f0;
    border: 1px solid #ffe0c0;
    color: #7a4100;
}

.tbreg-notice-info {
    background: #f0f7ff;
    border: 1px solid #c0dcff;
    color: #1a4a7a;
}

/* Bid blocked notice */
.tbreg-bid-blocked {
    font-family: var(--tbreg-font);
}

/* ================================
   WooCommerce /moje-konto/ Login
   ================================ */
.woocommerce-account:not(.logged-in) .woocommerce {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 16px;
    font-family: var(--tbreg-font);
}

.woocommerce-account .woocommerce h2,
.woocommerce-account .woocommerce .woocommerce-form-login h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--tbreg-text);
    text-align: center;
    margin: 0 0 8px;
}

.woocommerce-account .woocommerce-form-login {
    background: var(--tbreg-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid var(--tbreg-border) !important;
    padding: 40px 36px !important;
    margin: 0 !important;
    max-width: none;
}

@media (max-width: 600px) {
    .woocommerce-account .woocommerce-form-login { padding: 28px 20px !important; }
    .woocommerce-account:not(.logged-in) .woocommerce { margin: 20px auto; }
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-row,
.woocommerce-account .woocommerce-form-login .form-row {
    margin-bottom: 16px;
    padding: 0;
}

.woocommerce-account .woocommerce-form-login label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tbreg-text);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.woocommerce-account .woocommerce-form-login label .required {
    color: var(--tbreg-primary);
}

.woocommerce-account .woocommerce-form-login input[type="text"],
.woocommerce-account .woocommerce-form-login input[type="email"],
.woocommerce-account .woocommerce-form-login input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--tbreg-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--tbreg-text);
    background: var(--tbreg-bg-section);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.woocommerce-account .woocommerce-form-login input[type="text"]:focus,
.woocommerce-account .woocommerce-form-login input[type="email"]:focus,
.woocommerce-account .woocommerce-form-login input[type="password"]:focus {
    outline: none;
    border-color: var(--tbreg-primary);
    box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.1);
    background: #fff;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__rememberme {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tbreg-text);
    cursor: pointer;
    margin: 4px 0 0;
}

.woocommerce-account .woocommerce-form-login .woocommerce-form-login__rememberme input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tbreg-primary);
    cursor: pointer;
}

.woocommerce-account .woocommerce-form-login .woocommerce-button,
.woocommerce-account .woocommerce-form-login button[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    background: var(--tbreg-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tbreg-radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.02em;
    display: block;
    margin-top: 20px;
    text-align: center;
}

.woocommerce-account .woocommerce-form-login .woocommerce-button:hover,
.woocommerce-account .woocommerce-form-login button[type="submit"]:hover {
    background: var(--tbreg-primary-hover) !important;
}

.woocommerce-account .woocommerce-form-login .woocommerce-button:active,
.woocommerce-account .woocommerce-form-login button[type="submit"]:active {
    transform: scale(0.99);
}

.woocommerce-account .woocommerce-LostPassword {
    text-align: left;
    margin-top: 16px;
}

.woocommerce-account .woocommerce-LostPassword a {
    color: var(--tbreg-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.woocommerce-account .woocommerce-LostPassword a:hover {
    text-decoration: underline;
}

/* Hide WooCommerce register form if using custom registration */
.woocommerce-account .u-column2.col-2 {
    display: none;
}

/* WooCommerce notices */
.woocommerce-account:not(.logged-in) .woocommerce-error,
.woocommerce-account:not(.logged-in) .woocommerce-message,
.woocommerce-account:not(.logged-in) .woocommerce-info {
    max-width: 640px;
    margin: 0 auto 16px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--tbreg-font);
    border-top: none;
    list-style: none;
}

.woocommerce-account .woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--tbreg-error);
}

.woocommerce-account .woocommerce-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--tbreg-success);
}

.woocommerce-account .woocommerce-info {
    background: #f0f7ff;
    border: 1px solid #c0dcff;
    color: #1a4a7a;
}

/* Password show/hide toggle in WooCommerce */
.woocommerce-account .woocommerce-form-login .show-password-input {
    color: var(--tbreg-text-secondary);
    top: 50%;
    transform: translateY(-50%);
}

.woocommerce-account .woocommerce-form-login .show-password-input:hover {
    color: var(--tbreg-primary);
}
