/* Flag styles - base */
.dmua-flag {
    width: 24px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
	box-shadow: 0 0 2px rgba(0,0,0,0.9);
    margin-bottom: 0 !important;
}

/* Static flag display - no click, no dropdown */
.dmua-flag-static {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 16px;
    max-width: none;
    object-fit: cover;
    border-radius: 2px;
    pointer-events: none;
    box-shadow: 0 0 2px rgba(0,0,0,0.9);
}

/* Override theme CSS (e.g. BeTheme) that resets img dimensions with higher specificity */
.dmua-flag-container img.dmua-flag-static {
    width: 24px;
    height: 16px;
    max-width: none;
}

.dmua-flag-container {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

/* Input field */
.wpcf7-form-control-wrap[data-name^="phone"] input[type="text"] {
    flex: 1;
    min-width: 0;
    outline: none;
    padding: 0;
    margin: 0;
    line-height: 1.5;
}

/* Input padding when flag is shown */
.dmua-phone-input {
    padding-left: 35px;
}

/* Match default CF7 input style */
.wpcf7-form-control-wrap[data-name^="phone"] {
    position: relative;
    display: block;
    margin-bottom: 1em;
}

/* Theme mode validation */
.wpcf7-not-valid-tip {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
}

.wpcf7-valid-tip {
    position: absolute;
    left: 0;
	top: 100%;
    width: 100%;
    color: #28a745 !important;
    font-size: 0.875em;
    margin-top: 5px;
}

.wpcf7-form-control-wrap.dmua-is-complete .dmua-phone-input {
    border-color: #28a745 !important;
}

.wpcf7-form-control-wrap.dmua-is-complete .dmua-styled-input:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* Styles added for (dmua-styled-input) */
.dmua-styled-input {
    border-width: 1px;
    border-style: solid;
    border-color: #007bff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.dmua-styled-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.dmua-styled-field .dmua-flag-container {
    top: 53%;
}

.dmua-styled-field .dmua-phone-input {
    padding-left: 50px;
}

.dmua-styled-field .dmua-flag {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Multi-country dropdown: wider padding for trigger */
.dmua-has-dropdown .dmua-basic-input {
    padding-left: 50px;
}

.dmua-has-dropdown .dmua-styled-input {
    padding-left: 55px;
}

/* Dropdown trigger inside flag container */
.dmua-has-dropdown .dmua-flag-container {
    cursor: pointer;
}

/* Betheme theme specific fix for phone validation success message */
body.wp-theme-betheme .wpcf7-valid-tip {
    margin-top: 0px;
}
