/* ===== Nine Studio Theme Integration - Custom Overrides ===== */

/* --- Fix: Bootstrap 3 col-md-* columns inside .footer float left. If the .row::after
   clearfix doesn't contain them, .footer collapses to padding-only height and the
   column content renders against the white page background (the "half on white" bug).
   overflow:hidden creates a BFC that guarantees the footer contains its float children. --- */
.footer {
    overflow: hidden;
}

/* --- Fix: .copyright-container is float:left, collapsing .copyright to 0 height.
   overflow:hidden creates a new BFC so .copyright self-clears its floated child
   and has correct height with the dark #333 background fully visible. --- */
.copyright {
    overflow: hidden;
}

/* --- Fix: Nine Studio applies font-family:'ninestudio' !important to all [class^="ns-"]
   elements (intended for icon glyphs). Forms like ns-contact-form accidentally match
   this selector, causing all form text to render in the icon font.
   Reset to site font on form elements only — icon <i> elements inside forms are
   unaffected because Font Awesome/Ionicons also use !important on their own selectors. --- */
form[class*="ns-"],
form[class*="ns-"] input,
form[class*="ns-"] select,
form[class*="ns-"] textarea,
form[class*="ns-"] button,
form[class*="ns-"] label,
form[class*="ns-"] span,
form[class*="ns-"] div,
form[class*="ns-"] p,
form[class*="ns-"] strong,
form[class*="ns-"] small,
form[class*="ns-"] h1,
form[class*="ns-"] h2,
form[class*="ns-"] h3,
form[class*="ns-"] h4 {
    font-family: Lato, Helvetica, Arial, sans-serif !important;
}

/* --- Yii2 Form field reset to match Nine Studio style --- */
.ns-contact-form .field-contactform-name,
.ns-contact-form .field-contactform-email,
.ns-contact-form .field-contactform-subject,
.ns-contact-form .field-contactform-body,
.ns-contact-form .field-contactform-verifycode,
.ns-auth-form .field-signupform-username,
.ns-auth-form .field-signupform-email,
.ns-auth-form .field-signupform-password,
.ns-auth-form .field-loginform-username,
.ns-auth-form .field-loginform-password,
.ns-auth-form .field-loginform-rememberme {
    margin-bottom: 0;
}

/* Remove default Bootstrap 5 wrapper divs styling */
.ns-contact-form .form-group,
.ns-auth-form .form-group {
    margin-bottom: 0;
}

/* Style form inputs to match Nine Studio theme */
.ns-contact-form input[type="text"],
.ns-contact-form input[type="email"],
.ns-contact-form input[type="search"],
.ns-contact-form textarea,
.ns-auth-form input[type="text"],
.ns-auth-form input[type="email"],
.ns-auth-form input[type="password"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
    color: #333;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 20px;
    outline: none;
    display: block;
    -webkit-transition: border-color 0.3s;
    transition: border-color 0.3s;
}

.ns-contact-form input[type="text"]:focus,
.ns-contact-form input[type="email"]:focus,
.ns-contact-form textarea:focus,
.ns-auth-form input[type="text"]:focus,
.ns-auth-form input[type="email"]:focus,
.ns-auth-form input[type="password"]:focus {
    border-bottom-color: #e74c3c;
}

.ns-contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

/* Field error messages */
.ns-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: -15px;
    margin-bottom: 10px;
    display: block;
}

/* Captcha wrapper */
.ns-captcha-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ns-captcha-image img {
    border: 1px solid #ddd;
    cursor: pointer;
    transition: opacity .2s;
}
.ns-captcha-image img:hover {
    opacity: .75;
}

.ns-captcha-input input {
    margin-bottom: 0 !important;
}

/* --- Auth box (signup / login) --- */
.ns-auth-box {
    background: #fff;
    padding: 40px;
    border: 1px solid #eee;
}

.ns-btn-full {
    width: 100%;
    text-align: center;
    display: block;
}

/* --- Navbar button as link --- */
.btn-link-nav,
.btn-link-footer {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-link-nav:hover,
.btn-link-footer:hover {
    color: #e74c3c;
}

/* --- Alert messages (Yii2 flash messages) --- */
.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #f0faf0;
    border-left-color: #2ecc71;
    color: #27ae60;
}

.alert-danger,
.alert-error {
    background: #fdf7f7;
    border-left-color: #e74c3c;
    color: #c0392b;
}

.alert-warning {
    background: #fdf9f0;
    border-left-color: #f39c12;
    color: #d68910;
}

.alert-info {
    background: #f0f8ff;
    border-left-color: #3498db;
    color: #2980b9;
}

/* --- Error summary --- */
.error-summary {
    color: #c0392b;
    background: #fdf7f7;
    border-left: 3px solid #e74c3c;
    padding: 10px 20px;
    margin: 0 0 20px 0;
}

/* --- has-error class styling (Yii2 ActiveForm) --- */
.has-error input,
.has-error textarea {
    border-bottom-color: #e74c3c !important;
}

.has-error .help-block,
.has-error .invalid-feedback {
    color: #e74c3c;
    font-size: 12px;
    display: block;
}

/* --- Remove Bootstrap 5 form-control styling conflicts --- */
.form-control {
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    box-shadow: none;
    padding: 10px 0;
    background: transparent;
}

.form-control:focus {
    box-shadow: none;
    border-bottom-color: #e74c3c;
    background: transparent;
}

/* --- Utility spacers from Yii default --- */
.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* --- Google Map placeholder --- */
#googleMap {
    width: 100%;
    height: 400px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* --- Responsive helpers --- */
@media (max-width: 767px) {
    .ns-auth-box {
        padding: 25px 20px;
    }
    .ns-captcha-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}
