form.ag-form{
	position: relative;
}

.selected-option {
    background-color: #f0f0f0; /* Haalea harmaa taustaväri */
}
.agRadioRow label {
    width: 100%;
    cursor: pointer;
}
.ag-form .form-subtitle-line {
	display: flex;
	/* justify-content: center; */
	margin-bottom: var(--large);
	position: relative;
	text-align: center;
}
.ag-form .form-subtitle-line p {
    margin: 0;
    font-size: var(--font-medium);
    background: var(--color-w);
    z-index: 2;
    /* padding: 0 10px; */
    color: var(--color4);
    font-family: var(--ff2);
    width: max-content;
    font-weight: bold;
}
.ag-form .form-subtitle-line:after {
    /* content: ""; */
    width: 70%;
    border-bottom: 2px solid #dadada;
    position: absolute;
    top: var(--medium);
}

.custom-options {
	display: none;
	border: 1px solid #ccc;
	background-color: #fff;
	max-height: 200px;
	overflow-y: auto;
	position: absolute;
	z-index: 1000;
	width: 100%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	margin-top: -17px;
	border-radius: 0 0 4px 4px;
	border-top: 0;
}

.custom-option {
	padding: 10px;
	cursor: pointer;
}

.custom-option:hover {
	background-color: #f1f1f1;
}

.ag-form .same-row .form-row {
    width: 50%;
    position: relative;
}

.form-subtitle span {
	position: absolute;
	padding: 4px var(--large);
	background: var(--color1);
	color: var(--color-w);
	border-radius: 0 0 4px 0;
	display: none;
	top: -46px;
	left: -16px;
	font-weight: 500;
}

.ag-form .same-row .form-row:first-child {
    margin-right: 4px;
}

.ag-form .same-row {
    display: inline-flex;
    width: 100%;
    position: relative;
}

.content-box .form-row {
    position: relative;
}

.ag-contact-wrap h2 {
    font-family: var(--ff2);
    color: var(--color5);
}

.ag-form .form-row label {
    background: var(--color-w);
    color: var(--color5);
    font-family: var(--ff2);
    position: absolute;
    z-index: 1;
    top: 8px;
    left: 5px;
    padding: 0px 8px;
    transition: top .3s, left .3s, font-size .3s;
}

.ag-form .form-row textarea, .ag-form .form-row input, .ag-form .form-row select {
    background: transparent;
    padding: 9px;
    border: var(--poll-border);
    width: 100% !important;
    box-sizing: border-box;
    border-radius: 4px;
    margin-bottom: var(--large);
}

.ag-form .form-row textarea, .ag-form .form-row input {
    color: var(--color5);
}
.ag-form .form-row textarea {
    min-height: 100px;
}
.ag-form .form-row textarea::placeholder, .ag-form .form-row input::placeholder {
    color: var(--color-w);
}
.ag-form .form-row.active textarea::placeholder, .ag-form .form-row.active input::placeholder {
    color: var(--color5);
}

.ag-form button, .ag-form .button-wrapper input {
    border: 0;
    background: var(--color1) !important;
    padding: 10px;
    width: calc(50% - 8px);
    margin: var(--large) 0;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    color: var(--color-w);
    font-family: var(--ff2);
}

.ag-form .form-row.active label {
    top: -7px;
    left: 3px;
    font-size: 12px;
}

.ag-form .file label.field-label.extra {
    top: -9px;
    left: 3px;
    font-size: 12px;
}

.ag-form{
    width: 100%
}

.agFormRadio {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--xxxlarge);
}

.agRadioRow {
    /* width: 100%; */
    border: var(--main-border);
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.agFormRadio .form-subtitle-line {
    width: 100%;
}

.agRadioRowWrap {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 4px;
}

input[type="radio"] {
    filter: hue-rotate(360deg);
    cursor: pointer;
}

input[type="date"] {
    min-height: 36px;
}

.ag-form .same-row.agDatePick .form-row {
    width: 100%;
    margin: 0;
    transition: width 0.35s, opacity 0.35s;
}

.ag-form .same-row.agDatePick {
    column-gap: 4px;
}

.ag-form .same-row.agDatePick.active .form-row:has(#voimassapaattyen) {
    opacity: 0;
    width: 0;
}

.ag-form .same-row.agDatePick.active {
    column-gap: 0;
}

.ag-form .same-row.agDatePick .agFormField {
    max-height: 94px;
    overflow: hidden;
}


/* checkbox */
.ag-form .checkbox-row {
    display: flex;
    align-items: center;
    padding-bottom: var(--large);
}

/* Custom checkbox */
.ag-form .checkbox-row .agFormCheckbox {
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 16px;
    color: var(--color5);
    user-select: none;
}

.ag-form .checkbox-row .agFormCheckbox:before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color5);
    border-radius: 4px;
    background-color: white;
}

.ag-form .checkbox-row input[type="checkbox"]:checked + .agFormCheckbox:before {
    background-color: var(--color1);
    border-color: var(--color1);
}

.ag-form .checkbox-row input[type="checkbox"]:checked + .agFormCheckbox:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 5px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ag-form .form-checkbox {
    display: flex;
    align-items: center;
    margin: 0 0 var(--large);
}

.ag-form .form-checkbox input[type="checkbox"] {
    max-width: max-content;
    width: 20px;
    height: 20px;
    margin: 0 var(--small) 0 0;
	outline: none;
}

.ag-form .form-checkbox p {
    margin: 0;
}

.info-box p.success {
    background: var(--color1);
}

.info-box p {
	font-weight: 500;
	border-radius: 0 0 4px 0;
	color: var(--color-w);
	max-width: max-content;
	margin: 0;
	font-size: var(--font-medium);
	padding: var(--xsmall) var(--large);
}

.info-box {
    position: absolute;
    top: 0;
    width: 100%;
    left: 0;
}

.info-box p.fail, .info-box p.failv3 {
    background: #e43434;
}

/* Hover-efekti */
.ag-form .checkbox-row .agFormCheckbox:hover:before {
    border-color: var(--color1);
}

/* RV Spesifit */

.content-box-form {
    box-shadow: var(--bs);
    padding: var(--xxxxlarge) var(--large) var(--large);
    position: relative;
}

.tpl-sivu-new .content-box-form form {
    max-width: 100%;
}

.tpl-sivu-new .new-main-content .content-box-form h2 {
    margin-bottom: var(--xxlarge);
    margin-top: var(--xsmall);
}

.ag-form .form-row label.vedos, .ag-form .form-row.active label.vedos {
    top: 0px;
    left: 14px;
    font-size: 15px;
    background: initial;
    user-select: none;
}
